org.szegedi.nioserver.protocols
Class EchoProtocolHandlerFactory

java.lang.Object
  |
  +--org.szegedi.nioserver.protocols.EchoProtocolHandlerFactory
All Implemented Interfaces:
ProtocolHandlerFactory

public class EchoProtocolHandlerFactory
extends java.lang.Object
implements ProtocolHandlerFactory


Constructor Summary
EchoProtocolHandlerFactory(ByteBufferPool bufferPool)
           
 
Method Summary
 ProtocolHandler createProtocolHandler(java.nio.channels.SocketChannel socketChannel)
          Called whenever a connection is accepted on a server socket for which this factory was registered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EchoProtocolHandlerFactory

public EchoProtocolHandlerFactory(ByteBufferPool bufferPool)
Method Detail

createProtocolHandler

public ProtocolHandler createProtocolHandler(java.nio.channels.SocketChannel socketChannel)
Description copied from interface: ProtocolHandlerFactory
Called whenever a connection is accepted on a server socket for which this factory was registered.

Specified by:
createProtocolHandler in interface ProtocolHandlerFactory
Parameters:
socketChannel - the server socket channel that represents the server-side of the connection.
Returns:
a protocol handler instance (either new or pooled) that will service the read and write operations on the socket. Returning null will cause the server to refuse the connection.