net.officefloor.plugin.socket.server
Interface ConnectionHandlerContext

All Known Subinterfaces:
IdleContext, ReadContext, WriteContext
All Known Implementing Classes:
SocketListener, SslConnectionHandler

public interface ConnectionHandlerContext

Context that is available to all handle methods for the ConnectionHandler.

Author:
Daniel Sagenschneider

Method Summary
 Object getContextObject()
          Obtains the context bound object.
 long getTime()
           Obtains the current time in milliseconds.
 void setCloseConnection(boolean isClose)
          Flags to close the Connection.
 void setContextObject(Object contextObject)
          Specifies the context bound object.
 

Method Detail

setCloseConnection

void setCloseConnection(boolean isClose)
Flags to close the Connection.

Parameters:
isClose - true to close the Connection.

getTime

long getTime()

Obtains the current time in milliseconds.

This should return similar to System.currentTimeMillis() but is provided to cache time for multiple quick operations that require only estimates of time.

Note CPU operations should be in the nanoseconds.

Returns:
Time measured in milliseconds.

getContextObject

Object getContextObject()
Obtains the context bound object.

Returns:
Context bound object.

setContextObject

void setContextObject(Object contextObject)
Specifies the context bound object.

Parameters:
contextObject - Context bound object.


Copyright © 2005-2011. All Rights Reserved.