|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Driver
The Driver interface provides an abstraction for an implementation of a driver for the proton engine. A driver is responsible for providing input, output, and tick events, to the bottom half of the engine API. TODO See ::pn_input, ::pn_output, and ::pn_tick. The driver also provides an interface for the application to access, the top half of the API when the state of the engine may have changed due to I/O or timing events. Additionally the driver incorporates the SASL engine as well in order to provide a complete network stack: AMQP over SASL over TCP.
| Method Summary | ||
|---|---|---|
Connector |
connector()
Get the next active connector in the driver. |
|
Iterable<Connector> |
connectors()
Return an iterator over all connectors. |
|
|
createConnector(SelectableChannel fd,
C context)
Create a connector using the existing file descriptor. |
|
|
createConnector(String host,
int port,
C context)
Construct a connector to the given remote address. |
|
|
createListener(ServerSocketChannel c,
C context)
Create a listener using the existing channel. |
|
|
createListener(String host,
int port,
C context)
Construct a listener for the given address. |
|
void |
destroy()
Destruct the driver and all associated listeners, connectors and other resources. |
|
void |
doWait(long timeout)
Wait for an active connector or listener |
|
Listener |
listener()
Get the next listener with pending data in the driver. |
|
Iterable<Listener> |
listeners()
Return an iterator over all listeners. |
|
void |
wakeup()
Force wait() to return |
|
| Method Detail |
|---|
void wakeup()
void doWait(long timeout)
timeout - maximum time in milliseconds to wait.
0 means infinite waitListener listener()
Connector connector()
void destroy()
<C> Listener<C> createListener(String host,
int port,
C context)
host - local host address to listen onport - local port to listen oncontext - application-supplied, can be accessed via
getContext() method on a listener.
<C> Listener<C> createListener(ServerSocketChannel c,
C context)
c - existing SocketChannel for listener to listen oncontext - application-supplied, can be accessed via
getContext() method on a listener.
<C> Connector<C> createConnector(String host,
int port,
C context)
host - remote host to connect to.port - remote port to connect to.context - application-supplied, can be accessed via
getContext() method on a listener.
<C> Connector<C> createConnector(SelectableChannel fd,
C context)
fd - existing SocketChannel for listener to listen oncontext - application-supplied, can be accessed via
getContext() method on a listener.
Iterable<Listener> listeners()
Iterable<Connector> connectors()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||