Play! in Osaka #1
Netty                 2011.08.06 sat at Kronos




                    I/O
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




             NIO




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                 Grizzly
                 Apache MINA




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                Netty                    Java NIO
                                                    I/O




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                                          I/O
                                                I/O
                                         HTTP




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                                fork     Apache httpd


                  HTTP




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                                         fork


                                                fork
          OS

          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




         while(true){
                    Socket socket = serverSocket.accept();
                    Thread thread = new MyThread();
                    thread.start();
         }



             COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                                         Web




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




         accept




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                                         accept/read/write




                                            I/O


          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                                         I/O




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




      Java NIO                           I/O   accept




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




             NIO




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                 Grizzly
                 Apache MINA




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                         Java NIO        +




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                                         OutOfMemoryError
                HTTP
                Google Protocol Buffers
                Guice, Spring



          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                                Handler   ChannelPipeline




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




         SEDA(Staged Event Driven Archetechture)
         event handler
         Handler                         ChannelEvent
         ChannelPipeline                                Handler




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                                         ChannelHandler




                LifeCycleAwareChannel    ChannelUpstream   ChannelDownstream
                        Handler              Handler            Handler




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




        public interface ChannelUpstreamHandler extends ChannelHandler {

                /**
                 * Handles the specified upstream event.
                 *
                 * @param ctx the context object for this handler
                 * @param e    the upstream event to process or intercept
                 */
                void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e)
                                    throws Exception;
        }




            COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




        public interface ChannelDownstreamHandler extends ChannelHandler {

                /**
                 * Handles the specified downstream event.
                 *
                 * @param ctx the context object for this handler
                 * @param e    the downstream event to process or intercept
                 */
                void handleDownstream(ChannelHandlerContext ctx, ChannelEvent e)
                                    throws Exception;
        }




            COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                           SimpleChannel(Up|Down)StreamHandler




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




   Handler




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




          COPYRIGHT 2011 PLUGRAM, INC.
Play! in Osaka#1 Netty




                                 Netty
                                               NIO
                                             TCP/UDP




                                         Grizzly

          COPYRIGHT 2011 PLUGRAM, INC.
Nettyらへん

Nettyらへん

  • 1.
    Play! in Osaka#1 Netty 2011.08.06 sat at Kronos I/O
  • 2.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 3.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 4.
    Play! in Osaka#1Netty NIO COPYRIGHT 2011 PLUGRAM, INC.
  • 5.
    Play! in Osaka#1Netty Grizzly Apache MINA COPYRIGHT 2011 PLUGRAM, INC.
  • 6.
    Play! in Osaka#1Netty Netty Java NIO I/O COPYRIGHT 2011 PLUGRAM, INC.
  • 7.
    Play! in Osaka#1Netty I/O I/O HTTP COPYRIGHT 2011 PLUGRAM, INC.
  • 8.
    Play! in Osaka#1Netty fork Apache httpd HTTP COPYRIGHT 2011 PLUGRAM, INC.
  • 9.
    Play! in Osaka#1Netty fork fork OS COPYRIGHT 2011 PLUGRAM, INC.
  • 10.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 11.
    Play! in Osaka#1Netty while(true){ Socket socket = serverSocket.accept(); Thread thread = new MyThread(); thread.start(); } COPYRIGHT 2011 PLUGRAM, INC.
  • 12.
    Play! in Osaka#1Netty Web COPYRIGHT 2011 PLUGRAM, INC.
  • 13.
    Play! in Osaka#1Netty accept COPYRIGHT 2011 PLUGRAM, INC.
  • 14.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 15.
    Play! in Osaka#1Netty accept/read/write I/O COPYRIGHT 2011 PLUGRAM, INC.
  • 16.
    Play! in Osaka#1Netty I/O COPYRIGHT 2011 PLUGRAM, INC.
  • 17.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 18.
    Play! in Osaka#1Netty Java NIO I/O accept COPYRIGHT 2011 PLUGRAM, INC.
  • 19.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 20.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 21.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 22.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 23.
    Play! in Osaka#1Netty NIO COPYRIGHT 2011 PLUGRAM, INC.
  • 24.
    Play! in Osaka#1Netty Grizzly Apache MINA COPYRIGHT 2011 PLUGRAM, INC.
  • 25.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 26.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 27.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 28.
    Play! in Osaka#1Netty Java NIO + COPYRIGHT 2011 PLUGRAM, INC.
  • 29.
    Play! in Osaka#1Netty OutOfMemoryError HTTP Google Protocol Buffers Guice, Spring COPYRIGHT 2011 PLUGRAM, INC.
  • 30.
    Play! in Osaka#1Netty Handler ChannelPipeline COPYRIGHT 2011 PLUGRAM, INC.
  • 31.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 32.
    Play! in Osaka#1Netty SEDA(Staged Event Driven Archetechture) event handler Handler ChannelEvent ChannelPipeline Handler COPYRIGHT 2011 PLUGRAM, INC.
  • 33.
    Play! in Osaka#1Netty ChannelHandler LifeCycleAwareChannel ChannelUpstream ChannelDownstream Handler Handler Handler COPYRIGHT 2011 PLUGRAM, INC.
  • 34.
    Play! in Osaka#1Netty public interface ChannelUpstreamHandler extends ChannelHandler { /** * Handles the specified upstream event. * * @param ctx the context object for this handler * @param e the upstream event to process or intercept */ void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception; } COPYRIGHT 2011 PLUGRAM, INC.
  • 35.
    Play! in Osaka#1Netty public interface ChannelDownstreamHandler extends ChannelHandler { /** * Handles the specified downstream event. * * @param ctx the context object for this handler * @param e the downstream event to process or intercept */ void handleDownstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception; } COPYRIGHT 2011 PLUGRAM, INC.
  • 36.
    Play! in Osaka#1Netty SimpleChannel(Up|Down)StreamHandler COPYRIGHT 2011 PLUGRAM, INC.
  • 37.
    Play! in Osaka#1Netty Handler COPYRIGHT 2011 PLUGRAM, INC.
  • 38.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 39.
    Play! in Osaka#1Netty COPYRIGHT 2011 PLUGRAM, INC.
  • 40.
    Play! in Osaka#1Netty Netty NIO TCP/UDP Grizzly COPYRIGHT 2011 PLUGRAM, INC.