Class AsyncClientNioServer

java.lang.Object
java.lang.Thread
org.jppf.nio.NioServer
org.jppf.nio.StatelessNioServer<AsyncClientContext>
org.jppf.server.nio.client.AsyncClientNioServer
All Implemented Interfaces:
Runnable

public final class AsyncClientNioServer extends org.jppf.nio.StatelessNioServer<AsyncClientContext>
The NIO server that handles asynchronous client connections, which can handle multiple jobs concurrently.
Author:
Laurent Cohen
  • Constructor Details

    • AsyncClientNioServer

      public AsyncClientNioServer(JPPFDriver driver, int identifier, boolean useSSL) throws Exception
      Parameters:
      driver - reference to the driver.
      identifier - the channel identifier for channels handled by this server.
      useSSL - determines whether an SSLContext should be created for this server.
      Throws:
      Exception - if any error occurs.
  • Method Details

    • initReaderAndWriter

      protected void initReaderAndWriter()
      Specified by:
      initReaderAndWriter in class org.jppf.nio.StatelessNioServer<AsyncClientContext>
    • go

      protected void go(Set<SelectionKey> selectedKeys) throws Exception
      Overrides:
      go in class org.jppf.nio.StatelessNioServer<AsyncClientContext>
      Throws:
      Exception
    • handleSelectionException

      protected void handleSelectionException(SelectionKey key, Exception e)
      Specified by:
      handleSelectionException in class org.jppf.nio.StatelessNioServer<AsyncClientContext>
    • accept

      public void accept(ServerSocketChannel serverSocketChannel, SocketChannel channel, org.jppf.nio.SSLHandler sslHandler, boolean ssl, boolean peer, Object... params)
      Specified by:
      accept in class org.jppf.nio.NioServer
    • createNioContext

      public AsyncClientContext createNioContext(Object... params)
      Specified by:
      createNioContext in class org.jppf.nio.NioServer
    • closeConnection

      public void closeConnection(AsyncClientContext context)
      Close the specified channel.
      Parameters:
      context - the channel to close.
    • removeAllConnections

      public void removeAllConnections()
      Overrides:
      removeAllConnections in class org.jppf.nio.NioServer
    • getMessageHandler

      public AsyncClientMessageHandler getMessageHandler()
      Returns:
      the message handler for this server.
    • initNioHandlers

      protected void initNioHandlers()
      Overrides:
      initNioHandlers in class org.jppf.nio.StatelessNioServer<AsyncClientContext>