|
||||||||||
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 |
boolean |
isConnected()
Is the underlying channel connected. |
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. |
Methods inherited from interface com.sun.grizzly.async.AsyncQueueWritable |
---|
writeToAsyncQueue, writeToAsyncQueue, writeToAsyncQueue, writeToAsyncQueue, writeToAsyncQueue, writeToAsyncQueue, writeToAsyncQueue, writeToAsyncQueue |
Methods inherited from interface com.sun.grizzly.async.AsyncQueueReadable |
---|
readFromAsyncQueue, readFromAsyncQueue, readFromAsyncQueue |
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 Closeable
IOException
void finishConnect(SelectionKey key) throws IOException
key
- SelectionKey
IOException
void setController(Controller controller)
Controller
associated with this instance.
controller
- Controller
Controller getController()
Controller
E getSelectorHandler()
SelectorHandler
, which manages this
ConnectorHandler
SelectorHandler
SelectableChannel 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
- handlerboolean isConnected()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |