|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ConnectorHandler<E extends SelectorHandler,P extends CallbackHandler>
Client side interface used to implement non blocking client operation. Implementation of this class must make sure the following methods are invoked in that order: (1) connect() (2) read() or write().
| Method Summary | |
|---|---|
void |
close()
Close the underlying connection. |
void |
connect(SocketAddress remoteAddress)
Connect to hostname:port. |
void |
connect(SocketAddress remoteAddress,
P callbackHandler)
Connect to hostname:port. |
void |
connect(SocketAddress remoteAddress,
P callbackHandler,
E e)
Connect to hostname:port. |
void |
connect(SocketAddress remoteAddress,
SocketAddress localAddress)
Connect to hostname:port. |
void |
connect(SocketAddress remoteAddress,
SocketAddress localAddress,
P callbackHandler)
Connect to hostname:port. |
void |
connect(SocketAddress remoteAddress,
SocketAddress localAddress,
P callbackHandler,
E e)
Connect to hostname:port. |
void |
finishConnect(SelectionKey key)
Decide how the OP_CONNECT final steps are handled. |
P |
getCallbackHandler()
Returns ConnectorHandler's callback handler instance,
which is used to process occuring events |
Controller |
getController()
Return the Controller |
E |
getSelectorHandler()
Method returns SelectorHandler, which manages this
ConnectorHandler |
SelectableChannel |
getUnderlyingChannel()
Method returns ConnectorHandler's underlying channel |
Controller.Protocol |
protocol()
A token decribing the protocol supported by an implementation of this interface |
long |
read(ByteBuffer byteBuffer,
boolean blocking)
Read bytes. |
void |
setCallbackHandler(P callbackHandler)
Sets ConnectorHandler's callback handler instance,
which is used to process occuring events |
void |
setController(Controller controller)
Set the Controller associated with this instance. |
long |
write(ByteBuffer byteBuffer,
boolean blocking)
Writes bytes. |
| Method Detail |
|---|
Controller.Protocol protocol()
Controller.Protocol
void connect(SocketAddress remoteAddress,
P callbackHandler,
E e)
throws IOException
Controller will invoke
the CallBackHandler.
remoteAddress - remote address to connectcallbackHandler - the handler invoked by the Controller when
an non blocking operation is ready to be handled.e - SelectorHandler
IOException
void connect(SocketAddress remoteAddress,
P callbackHandler)
throws IOException
Controller will invoke
the CallBackHandler.
remoteAddress - remote address to connectcallbackHandler - the handler invoked by the Controller when
an non blocking operation is ready to be handled.
IOException
void connect(SocketAddress remoteAddress)
throws IOException
remoteAddress - remote address to connect
IOException
void connect(SocketAddress remoteAddress,
SocketAddress localAddress,
P callbackHandler,
E e)
throws IOException
Controller will invoke
the CallBackHandler.
remoteAddress - remote address to connectlocalAddress - local address to bindcallbackHandler - the handler invoked by the Controller when
an non blocking operation is ready to be handled.e - SelectorHandler
IOException
void connect(SocketAddress remoteAddress,
SocketAddress localAddress,
P callbackHandler)
throws IOException
Controller will invoke
the CallBackHandler.
remoteAddress - remote address to connectlocalAddress - local address to bindcallbackHandler - the handler invoked by the Controller when
an non blocking operation is ready to be handled.
IOException
void connect(SocketAddress remoteAddress,
SocketAddress localAddress)
throws IOException
remoteAddress - remote address to connectlocalAddress - local address to bind
IOException
long read(ByteBuffer byteBuffer,
boolean blocking)
throws IOException
Selector will be used to read bytes.
byteBuffer - The byteBuffer to store bytes.blocking - true if a a pool of temporary Selector
is required to handle a blocking read.
IOException
long write(ByteBuffer byteBuffer,
boolean blocking)
throws IOException
Selector will be used to writes bytes.
byteBuffer - The byteBuffer to write.blocking - true if a a pool of temporary Selector
is required to handle a blocking write.
IOException
void close()
throws IOException
close in interface CloseableIOException
void finishConnect(SelectionKey key)
throws IOException
key - SelectionKey
IOExceptionvoid setController(Controller controller)
Controller associated with this instance.
controller - ControllerController getController()
Controller
E getSelectorHandler()
SelectorHandler, which manages this
ConnectorHandler
SelectorHandlerSelectableChannel getUnderlyingChannel()
ConnectorHandler's underlying channel
P getCallbackHandler()
ConnectorHandler's callback handler instance,
which is used to process occuring events
void setCallbackHandler(P callbackHandler)
ConnectorHandler's callback handler instance,
which is used to process occuring events
callbackHandler - handler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||