SlideShare a Scribd company logo
1 of 26
Download to read offline
‹#›
‹#›
‹#›
‹#›
‹#›
‹#›
‹#›
‹#›
‹#›
‹#›
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	
  
                                                         Thread
9                                               8




                                                                        ‹#›
                 	
	
                                            	
                    	



       B	
                       B	
  
               Thread-­‐1	
                        Thread-­‐1	
  

       B	
                       B	
  
               Thread-­‐2	
                        Thread-­‐2	
  

       B	
                       B	
  
               Thread-­‐3	
                        Thread-­‐3	
  




                                                                         ‹#›
‹#›
no9fy

no9fy




        ‹#›
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, GrizzlyResponse
response) {!
        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 static
content");!
!
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@7e8e
68bd, 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!




                                 ‹#›
‹#›

More Related Content

What's hot

Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
som_nangia
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Tatsuhiko Miyagawa
 

What's hot (19)

Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
 
Sinatra Rack And Middleware
Sinatra Rack And MiddlewareSinatra Rack And Middleware
Sinatra Rack And Middleware
 
Quick Intro To JRuby
Quick Intro To JRubyQuick Intro To JRuby
Quick Intro To JRuby
 
mruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなしmruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなし
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Devignition 2011
Devignition 2011Devignition 2011
Devignition 2011
 
A tour of (advanced) Akka features in 40 minutes
A tour of (advanced) Akka features in 40 minutesA tour of (advanced) Akka features in 40 minutes
A tour of (advanced) Akka features in 40 minutes
 
Tatsumaki
TatsumakiTatsumaki
Tatsumaki
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyists
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
Beyond Phoenix
Beyond PhoenixBeyond Phoenix
Beyond Phoenix
 
Practical ngx_mruby
Practical ngx_mrubyPractical ngx_mruby
Practical ngx_mruby
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.eu
 
Message queueing
Message queueingMessage queueing
Message queueing
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStack
 
Message Queueing - by an MQ noob
Message Queueing - by an MQ noobMessage Queueing - by an MQ noob
Message Queueing - by an MQ noob
 

Similar to Grizzly1.9.3x

OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
Tom Croucher
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
Nobuo Danjou
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & java
Eugene Bogaart
 
Node js quick tour v2
Node js quick tour v2Node js quick tour v2
Node js quick tour v2
Wyatt Fang
 

Similar to Grizzly1.9.3x (20)

Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
Run Node Run
Run Node RunRun Node Run
Run Node Run
 
Understanding the Rails web model and scalability options
Understanding the Rails web model and scalability optionsUnderstanding the Rails web model and scalability options
Understanding the Rails web model and scalability options
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
 
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & java
 
Node.js - Advanced Basics
Node.js - Advanced BasicsNode.js - Advanced Basics
Node.js - Advanced Basics
 
VUG5: Varnish at Opera Software
VUG5: Varnish at Opera SoftwareVUG5: Varnish at Opera Software
VUG5: Varnish at Opera Software
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Node js quick tour v2
Node js quick tour v2Node js quick tour v2
Node js quick tour v2
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?
 
Deployment de Rails
Deployment de RailsDeployment de Rails
Deployment de Rails
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
Rails Performance
Rails PerformanceRails Performance
Rails Performance
 

More from Yoshio Terada

More from Yoshio Terada (20)

AI-Java-for-Financial.pdf
AI-Java-for-Financial.pdfAI-Java-for-Financial.pdf
AI-Java-for-Financial.pdf
 
Java-Virtual-Thread-LT.pdf
Java-Virtual-Thread-LT.pdfJava-Virtual-Thread-LT.pdf
Java-Virtual-Thread-LT.pdf
 
Cloud Native Architecture ことはじめ 最適な実行環境を選ぶポイント
Cloud Native Architecture ことはじめ 最適な実行環境を選ぶポイントCloud Native Architecture ことはじめ 最適な実行環境を選ぶポイント
Cloud Native Architecture ことはじめ 最適な実行環境を選ぶポイント
 
Jakarta EE Microproile Update JJUG 2020 May
Jakarta EE Microproile Update JJUG 2020 MayJakarta EE Microproile Update JJUG 2020 May
Jakarta EE Microproile Update JJUG 2020 May
 
Azure RedHat OpenShift - Red Hat Forum 2019
Azure RedHat OpenShift - Red Hat Forum 2019Azure RedHat OpenShift - Red Hat Forum 2019
Azure RedHat OpenShift - Red Hat Forum 2019
 
JakartaOne 2020 Japan Announce
JakartaOne 2020 Japan AnnounceJakartaOne 2020 Japan Announce
JakartaOne 2020 Japan Announce
 
Jjug CCC 2019 Fall Azure Spring Cloud
Jjug CCC 2019 Fall Azure Spring CloudJjug CCC 2019 Fall Azure Spring Cloud
Jjug CCC 2019 Fall Azure Spring Cloud
 
Sapporo Developer Festa 2019
Sapporo Developer Festa 2019Sapporo Developer Festa 2019
Sapporo Developer Festa 2019
 
AKS (k8s) Hands on Lab Contents
AKS (k8s) Hands on Lab ContentsAKS (k8s) Hands on Lab Contents
AKS (k8s) Hands on Lab Contents
 
Java on Azure 2019
Java on Azure 2019Java on Azure 2019
Java on Azure 2019
 
Java on Azure 2019
Java on Azure 2019Java on Azure 2019
Java on Azure 2019
 
Oisix ra Daichi Microservice with Kubernetes
Oisix ra Daichi Microservice with Kubernetes Oisix ra Daichi Microservice with Kubernetes
Oisix ra Daichi Microservice with Kubernetes
 
Virtual Kubelet and Virtual Node
Virtual Kubelet and Virtual NodeVirtual Kubelet and Virtual Node
Virtual Kubelet and Virtual Node
 
Japan Container Day 2018
Japan Container Day 2018Japan Container Day 2018
Japan Container Day 2018
 
Java on Kubernetes on Azure
Java on Kubernetes on AzureJava on Kubernetes on Azure
Java on Kubernetes on Azure
 
The Experience of Java on Kubernetes with Microservices from HackFest
The Experience of Java on Kubernetes with Microservices from HackFestThe Experience of Java on Kubernetes with Microservices from HackFest
The Experience of Java on Kubernetes with Microservices from HackFest
 
Application Development Vision
Application Development VisionApplication Development Vision
Application Development Vision
 
How to face the Kubernetes ?
How to face the Kubernetes ? How to face the Kubernetes ?
How to face the Kubernetes ?
 
JavaOne 2016 Report for Java EE
JavaOne 2016 Report for Java EEJavaOne 2016 Report for Java EE
JavaOne 2016 Report for Java EE
 
Istio on k8s on Azure (AKS)
Istio on k8s on Azure (AKS)Istio on k8s on Azure (AKS)
Istio on k8s on Azure (AKS)
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Grizzly1.9.3x

  • 11. 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   Thread 9 8 ‹#›
  • 12.     B   B   Thread-­‐1   Thread-­‐1   B   B   Thread-­‐2   Thread-­‐2   B   B   Thread-­‐3   Thread-­‐3   ‹#›
  • 14. no9fy no9fy ‹#›
  • 15. 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);! ‹#›
  • 16. 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); // ! ‹#›
  • 19. 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"));! ‹#›
  • 20. public class HelloWorldAdapter extends GrizzlyAdapter {! @Override! public void service(GrizzlyRequest request, GrizzlyResponse response) {! 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 ‹#›
  • 21. GrizzlyWebServer gws = new GrizzlyWebServer(8080, "no static content");! ! ServletAdapter simpleServletAdapter = new ServletAdapter();! simpleServletAdapter.setContextPath("/hello");! simpleServletAdapter.setServletInstance(new MyServlet());! gws.addGrizzlyAdapter(simpleServletAdapter, new String[]{"/ hello"});! ! gws.start();! ‹#›
  • 23. -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@7e8e 68bd, 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|#]!
  • 24. -­‐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   ‹#›
  • 25. -client! -Xmx512m! -server ! -Xmx3500m -Xms3500m -Xss128k ! -XX:+AggressiveHeap ! -XX:+DisableExplicitGC! ‹#›