• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Grizzly1.9.3x
 

Grizzly1.9.3x

on

  • 1,988 views

This explain the history and the new feature of Grizzly.

This explain the history and the new feature of Grizzly.

Statistics

Views

Total Views
1,988
Views on SlideShare
1,982
Embed Views
6

Actions

Likes
1
Downloads
8
Comments
0

2 Embeds 6

http://twitter.com 4
https://twitter.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Grizzly1.9.3x Grizzly1.9.3x Presentation Transcript

    • ‹#›
    • ‹#›
    • ‹#›
    • ‹#›
    • ‹#›
    • ‹#›
    • ‹#›
    • ‹#›
    • ‹#›
    • ‹#›
    • 6 Worker   Thread Worker   Thread Web Container Worker   HTTP Engine Thread Worker   VS Select Thread Acceptor   Worker   NSAPI Engine Thread Thread 4 5 Acceptor   Worker   … Thread Thread 1 2 3 7 KeepAlive   Thread KeepAlive   Thread9 8 ‹#›
    •     B   B   Thread-­‐1   Thread-­‐1   B   B   Thread-­‐2   Thread-­‐2   B   B   Thread-­‐3   Thread-­‐3   ‹#›
    • ‹#›
    • no9fyno9fy ‹#›
    • Selector selector = Selector.open();!ServerSocketChannel serverChannel = ServerSocketChannel.open();!serverChannel.configureBlocking(false);// !serverChannel.socket().bind(new InetSocketAddress(9090));!serverChannel.register(selector, SelectionKey.OP_ACCEPT);!while (selector.select() > 0) {!    for (Iterator it = selector.selectedKeys().iterator();it.hasNext();) {!       SelectionKey key = (SelectionKey) it.next();!       it.remove();!       if (key.isAcceptable()) {!           ServerSocketChannel serverChannel =! (ServerSocketChannel) key.channel();! SocketChannel channel = serverChannel.accept();! channel.configureBlocking(false);!           channel.register(selector, SelectionKey.OP_READ);! ‹#›
    • SocketChannel channel = serverChannel.accept();!AsynchronousServerSocketChannel server =AsynchronousServerSocketChannel.open().bind(9900);!Future<AsynchronousSocketChannel> acceptFuture = server.accept();!AsynchronousSocketChannel worker = future.get();!//AsynchronousSocketChannel worker = future.get(10,TimeUnit.SECONDS); // ! ‹#›
    • ‹#›
    • ‹#›
    • GlassFish glassfish = GlassFishRuntime.bootstrap().! ! ! ! ! ! ! !newGlassFish();!glassfish.start();!!CommandRunner commandRunner = glassfish.getService(CommandRunner.class);!CommandResult commandResult = commandRunner.run("create-http-listener", "--listenerport=9090", "--listeneraddress=0.0.0.0","--defaultvs=server", "my-http-listener");!!Deployer deployer = glassfish.getDeployer();!deployer.deploy(new File(“HelloWorldWeb-GA.war"));! ‹#›
    • public class HelloWorldAdapter extends GrizzlyAdapter {! @Override! public void service(GrizzlyRequest request, GrizzlyResponseresponse) {! try {! response.getWriter().println("HelloWorld");! } catch (IOException ex) {! ex.printStackTrace();! }}!<adapters>! <adapter context-root="/helloworld" class-name="co.jp.oracle.http.HelloWorldAdapter"/>!</adapters>!> asadmin deploy helloworld.jar ‹#›
    • GrizzlyWebServer gws = new GrizzlyWebServer(8080, "no staticcontent");!!ServletAdapter simpleServletAdapter = new ServletAdapter();!simpleServletAdapter.setContextPath("/hello");!simpleServletAdapter.setServletInstance(new MyServlet());!gws.addGrizzlyAdapter(simpleServletAdapter, new String[]{"/hello"});!!gws.start();! ‹#›
    • ‹#›
    • -Dcom.sun.grizzly.displayConfiguration = true!Grizzly running on Darwin - 10.8.0 under JDK version: 1.7.0-internal -Oracle Corporation ! port: 4848! Thread Pool:com.sun.enterprise.v3.services.impl.monitor.MonitorableThreadPool@7e8e68bd, port=4848! Read Selector: -1! ByteBuffer size: 8192 ! maxHttpHeaderSize: 8192! sendBufferSize: 8192! maxKeepAliveRequests: 250! keepAliveTimeoutInSeconds: 30 ! Static File Cache enabled: false! ‹#› Adapter : com.sun.enterprise.v3.services.impl.ContainerMapper ! Asynchronous Request Processing enabled: false|#]!
    • -­‐Dcom.sun.grizzly.enableSnoop=true![#|2011-­‐09-­‐01T22:00:39.319+0900|INFO|glassfish3.1.1|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=67;_ThreadName=Thread-­‐2;|GRIZZLY0020:  SocketChannel  headers  java.nio.channels.SocketChannel[connected  local=/127.0.0.1:4848  remote=/127.0.0.1:55379]  are:    ===  MimeHeaders  ===  host  =  127.0.0.1:4848  user-­‐agent  =  Mozilla/5.0  (Macintosh;  Intel  Mac  OS  X  10.6;  rv:6.0.1)  Gecko/20100101  Firefox/6.0.1  accept  =  text/html,applica9on/xhtml+xml,applica9on/xml;q=0.9,*/*;q=0.8  accept-­‐language  =  ja,en;q=0.7,en-­‐us;q=0.3  accept-­‐encoding  =  gzip,  deflate  accept-­‐charset  =  Shil_JIS,un-­‐8;q=0.7,*;q=0.7   ‹#›
    • -client!-Xmx512m!-server !-Xmx3500m -Xms3500m -Xss128k !-XX:+AggressiveHeap !-XX:+DisableExplicitGC! ‹#›
    • ‹#›