Driver.Factory| Constructor and Description |
|---|
DriverImpl() |
| Modifier and Type | Method and Description |
|---|---|
Connector |
connector()
Get the next active connector in the driver.
|
java.lang.Iterable<Connector> |
connectors()
Return an iterator over all connectors.
|
<C> Connector<C> |
createConnector(java.nio.channels.SelectableChannel c,
C context)
Create a connector using the existing file descriptor.
|
<C> Connector<C> |
createConnector(java.lang.String host,
int port,
C context)
Construct a connector to the given remote address.
|
<C> Listener<C> |
createListener(java.nio.channels.ServerSocketChannel c,
C context)
Create a listener using the existing channel.
|
<C> Listener<C> |
createListener(java.lang.String host,
int port,
C context)
Construct a listener for the given address.
|
protected <C> Connector<C> |
createServerConnector(java.nio.channels.SelectableChannel c,
C context,
Listener<C> l) |
void |
destroy()
Destruct the driver and all associated listeners, connectors and other resources.
|
boolean |
doWait(long timeout)
Wait for an active connector or listener, or for
Driver.wakeup() to be called. |
Listener |
listener()
Get the next listener with pending data in the driver.
|
java.lang.Iterable<Listener> |
listeners()
Return an iterator over all listeners.
|
<C> void |
removeConnector(Connector<C> c) |
void |
wakeup()
Force
Driver.doWait(long) to return. |
public DriverImpl()
throws java.io.IOException
java.io.IOExceptionpublic void wakeup()
DriverDriver.doWait(long) to return.
If the driver is not currently waiting then the next invocation of Driver.doWait(long)
will return immediately unless the Driver.connector() method is invoked in the meantime.
Thread-safe.public boolean doWait(long timeout)
DriverDriver.wakeup() to be called.
Thread-safe.public Listener listener()
Driverpublic Connector connector()
DriverDriver.wakeup().public void destroy()
Driverpublic <C> Listener<C> createListener(java.lang.String host, int port, C context)
DrivercreateListener in interface Driverhost - local host address to listen onport - local port to listen oncontext - application-supplied, can be accessed via
getContext() method on a listener.public <C> Listener<C> createListener(java.nio.channels.ServerSocketChannel c, C context)
DrivercreateListener in interface Driverc - existing SocketChannel for listener to listen oncontext - application-supplied, can be accessed via
getContext() method on a listener.public <C> Connector<C> createConnector(java.lang.String host, int port, C context)
DrivercreateConnector in interface Driverhost - remote host to connect to.port - remote port to connect to.context - application-supplied, can be accessed via
getContext() method on a listener.public <C> Connector<C> createConnector(java.nio.channels.SelectableChannel c, C context)
DrivercreateConnector in interface Driverc - existing SocketChannel for listener to listen oncontext - application-supplied, can be accessed via
getContext() method on a listener.public <C> void removeConnector(Connector<C> c)
public java.lang.Iterable<Listener> listeners()
Driverpublic java.lang.Iterable<Connector> connectors()
Driverconnectors in interface DriverCopyright © 2014 FuseSource, Corp.. All Rights Reserved.