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

java.lang.Object
  extended by net.officefloor.plugin.socket.server.tcp.protocol.TcpServer
All Implemented Interfaces:
Server<TcpConnectionHandler>

public class TcpServer
extends Object
implements Server<TcpConnectionHandler>

TCP Server.

Author:
Daniel Sagenschneider

Constructor Summary
TcpServer(int newConnectionFlowIndex)
          Initiate.
 
Method Summary
 void processRequest(TcpConnectionHandler connectionHandler, Object attachment)
           Starts the processing the request identified by the ConnectionHandler with the Server.
 void setManagedObjectExecuteContext(ManagedObjectExecuteContext<Indexed> executeContext)
          Provides the Server the ManagedObjectExecuteContext to enable it to invoke ProcessState instances to process input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TcpServer

public TcpServer(int newConnectionFlowIndex)
Initiate.

Parameters:
newConnectionFlowIndex - Flow index to handle a new connection.
Method Detail

setManagedObjectExecuteContext

public void setManagedObjectExecuteContext(ManagedObjectExecuteContext<Indexed> executeContext)
Description copied from interface: Server
Provides the Server the ManagedObjectExecuteContext to enable it to invoke ProcessState instances to process input.

Specified by:
setManagedObjectExecuteContext in interface Server<TcpConnectionHandler>
Parameters:
executeContext - ManagedObjectExecuteContext.

processRequest

public void processRequest(TcpConnectionHandler connectionHandler,
                           Object attachment)
                    throws IOException
Description copied from interface: Server

Starts the processing the request identified by the ConnectionHandler with the Server.

To process a stream of input have the ConnectionHandler complete the Request with zero size and use the Connection passed to the ConnectionHandler.

Specified by:
processRequest in interface Server<TcpConnectionHandler>
Parameters:
connectionHandler - ConnectionHandler for the Connection.
attachment - Optional attachment provided by the ConnectionHandler specific to this request. May be null.
Throws:
IOException - If fails to start processing the request.


Copyright © 2005-2011. All Rights Reserved.