|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.danube.service.server.ServerConnectionHandler
public class ServerConnectionHandler
This class is entry point for typical server that handles request sequentially.
Field Summary | |
---|---|
protected ConnectionHandler |
connectionHandler
Connection Handler |
protected org.slf4j.Logger |
logger
Logger |
Constructor Summary | |
---|---|
ServerConnectionHandler()
Constructor |
Method Summary | |
---|---|
protected void |
closeConnection(Connection connection)
Closes connection. |
protected Connection |
decorateConnection(Connection connection)
This method can "decorate" connection wrapping it with own. |
protected void |
finishProcessingConnection(Connection connection,
boolean closedConnection)
Finishes connection for this server connection handler. |
ConnectionHandler |
getConnectionHandler()
Returns connection handler |
void |
handleConnection(Connection connection)
This template method allows connection to be wrapped and then processes sequential requests/commands while socket is open or an exception occurs. |
protected boolean |
postProcessing(Connection connection)
Post processing that should determine shell we persist connection (invoke handler again) or leave connection handler. |
protected void |
processConnection(Connection connection)
Template method for processing of connection. |
void |
setConnectionHandler(ConnectionHandler connectionHandler)
Sets connection handler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.slf4j.Logger logger
protected ConnectionHandler connectionHandler
Constructor Detail |
---|
public ServerConnectionHandler()
Method Detail |
---|
public void setConnectionHandler(ConnectionHandler connectionHandler)
connectionHandler
- public ConnectionHandler getConnectionHandler()
public void handleConnection(Connection connection) throws ConnectionException
handleConnection
in interface ConnectionHandler
connection
- socket connection
ConnectionException
protected void processConnection(Connection connection)
connection
- decoratedprotected Connection decorateConnection(Connection connection)
connection
- original conneciton
protected boolean postProcessing(Connection connection)
connection
- decorated connection
true
if we should persist connectionprotected void closeConnection(Connection connection)
connection
- decorated connectionprotected void finishProcessingConnection(Connection connection, boolean closedConnection)
connection
- decorated connectionclosedConnection
- has closeConnection(Connection)
method called before
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |