net.officefloor.plugin.socket.server.tcp.protocol
Class TcpCommunicationProtocol

java.lang.Object
  extended by net.officefloor.plugin.socket.server.tcp.protocol.TcpCommunicationProtocol
All Implemented Interfaces:
CommunicationProtocol<TcpConnectionHandler>, ServerSocketHandler<TcpConnectionHandler>

public class TcpCommunicationProtocol
extends Object
implements CommunicationProtocol<TcpConnectionHandler>, ServerSocketHandler<TcpConnectionHandler>

TCP CommunicationProtocol.

Author:
Daniel Sagenschneider

Field Summary
static String PROPERTY_MAXIMUM_IDLE_TIME
          Property to obtain the maximum idle time before the Connection is closed.
 
Constructor Summary
TcpCommunicationProtocol()
           
 
Method Summary
 TcpConnectionHandler createConnectionHandler(Connection connection)
          Creates a ConnectionHandler for a new Connection.
 Server<TcpConnectionHandler> createServer()
          Creates the Server to handle requests.
 ServerSocketHandler<TcpConnectionHandler> createServerSocketHandler(AbstractAsyncManagedObjectSource.MetaDataContext<None,Indexed> context, BufferSquirtFactory bufferSquirtFactory)
          Creates the ServerSocketHandler.
 void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
          Loads any specifications for this communication protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_MAXIMUM_IDLE_TIME

public static final String PROPERTY_MAXIMUM_IDLE_TIME
Property to obtain the maximum idle time before the Connection is closed.

See Also:
Constant Field Values
Constructor Detail

TcpCommunicationProtocol

public TcpCommunicationProtocol()
Method Detail

loadSpecification

public void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Description copied from interface: CommunicationProtocol
Loads any specifications for this communication protocol.

Specified by:
loadSpecification in interface CommunicationProtocol<TcpConnectionHandler>
Parameters:
context - AbstractAsyncManagedObjectSource.SpecificationContext.

createServerSocketHandler

public ServerSocketHandler<TcpConnectionHandler> createServerSocketHandler(AbstractAsyncManagedObjectSource.MetaDataContext<None,Indexed> context,
                                                                           BufferSquirtFactory bufferSquirtFactory)
                                                                    throws Exception
Description copied from interface: CommunicationProtocol
Creates the ServerSocketHandler.

Specified by:
createServerSocketHandler in interface CommunicationProtocol<TcpConnectionHandler>
Parameters:
context - AbstractAsyncManagedObjectSource.MetaDataContext.
bufferSquirtFactory - BufferSquirtFactory.
Throws:
Exception - If fails to create the ServerSocketHandler.

createServer

public Server<TcpConnectionHandler> createServer()
Description copied from interface: ServerSocketHandler
Creates the Server to handle requests.

Specified by:
createServer in interface ServerSocketHandler<TcpConnectionHandler>
Returns:
Server to handle requests.

createConnectionHandler

public TcpConnectionHandler createConnectionHandler(Connection connection)
Description copied from interface: ServerSocketHandler
Creates a ConnectionHandler for a new Connection.

Specified by:
createConnectionHandler in interface ServerSocketHandler<TcpConnectionHandler>
Parameters:
connection - A new Connection requiring handling.
Returns:
ConnectionHandler to handle the new Connection.


Copyright © 2005-2011. All Rights Reserved.