|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.AbstractSocketConnectorHandler
public abstract class AbstractSocketConnectorHandler
Abstract class simplifies the implementation of
SocketConnectorHandler
interface by pre-implementing some of its methods.
| Nested Class Summary | |
|---|---|
static class |
AbstractSocketConnectorHandler.Builder<E extends AbstractSocketConnectorHandler.Builder>
Builder |
| Field Summary | |
|---|---|
protected java.util.List<ConnectionProbe> |
probes
|
protected Transport |
transport
|
| Constructor Summary | |
|---|---|
AbstractSocketConnectorHandler(Transport transport)
|
|
| Method Summary | |
|---|---|
void |
addMonitoringProbe(ConnectionProbe probe)
Add the ConnectionProbe, which will be notified about
Connection life-cycle events. |
GrizzlyFuture<Connection> |
connect(java.net.SocketAddress remoteAddress)
Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket. |
GrizzlyFuture<Connection> |
connect(java.net.SocketAddress remoteAddress,
CompletionHandler<Connection> completionHandler)
Creates, initializes and connects socket to the specific SocketAddress and returns Connection, representing socket. |
GrizzlyFuture<Connection> |
connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket. |
abstract GrizzlyFuture<Connection> |
connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
Creates, initializes socket, binds it to the specific local and remote SocketAddress and returns Connection, representing socket. |
GrizzlyFuture<Connection> |
connect(java.lang.String host,
int port)
Creates, initializes and connects socket to the specific remote host and port and returns Connection, representing socket. |
ConnectionProbe[] |
getMonitoringProbes()
Get the ConnectionProbe, which are registered on the Connection. |
Processor |
getProcessor()
Get the default Processor to process IOEvent, occurring
on connection phase. |
ProcessorSelector |
getProcessorSelector()
Gets the default ProcessorSelector, which will be used to get
Processor to process I/O events, occurring on connection phase. |
protected void |
preConfigure(Connection connection)
Pre-configures Connection object before actual connecting phase
will be started. |
boolean |
removeMonitoringProbe(ConnectionProbe probe)
Remove the ConnectionProbe. |
void |
setProcessor(Processor processor)
Set the default Processor to process IOEvent, occurring
on connection phase. |
void |
setProcessorSelector(ProcessorSelector processorSelector)
Sets the default ProcessorSelector, which will be used to get
Processor to process I/O events, occurring on connection phase. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Transport transport
protected final java.util.List<ConnectionProbe> probes
| Constructor Detail |
|---|
public AbstractSocketConnectorHandler(Transport transport)
| Method Detail |
|---|
public GrizzlyFuture<Connection> connect(java.lang.String host,
int port)
throws java.io.IOException
SocketConnectorHandlerConnection, representing socket.
connect in interface SocketConnectorHandlerhost - remote host to connect to.port - remote port to connect to.
Future of connect operation, which could be used to get
resulting Connection.
java.io.IOException
public GrizzlyFuture<Connection> connect(java.net.SocketAddress remoteAddress)
throws java.io.IOException
ConnectorHandlerSocketAddress and returns Connection, representing socket.
connect in interface ConnectorHandler<java.net.SocketAddress>remoteAddress - remote address to connect to.
Future of connect operation, which could be used to get
resulting Connection.
java.io.IOException
public GrizzlyFuture<Connection> connect(java.net.SocketAddress remoteAddress,
CompletionHandler<Connection> completionHandler)
throws java.io.IOException
ConnectorHandlerSocketAddress and returns Connection, representing socket.
connect in interface ConnectorHandler<java.net.SocketAddress>remoteAddress - remote address to connect to.completionHandler - CompletionHandler.
Future of connect operation, which could be used to get
resulting Connection.
java.io.IOException
public GrizzlyFuture<Connection> connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress)
throws java.io.IOException
ConnectorHandlerSocketAddress and returns Connection, representing socket.
connect in interface ConnectorHandler<java.net.SocketAddress>remoteAddress - remote address to connect to.localAddress - local address to bind socket to.
Future of connect operation, which could be used to get
resulting Connection.
java.io.IOException
public abstract GrizzlyFuture<Connection> connect(java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
throws java.io.IOException
ConnectorHandlerSocketAddress and returns Connection, representing socket.
connect in interface ConnectorHandler<java.net.SocketAddress>remoteAddress - remote address to connect to.localAddress - local address to bind socket to.completionHandler - CompletionHandler.
Future of connect operation, which could be used to get
resulting Connection.
java.io.IOExceptionpublic Processor getProcessor()
Processor to process IOEvent, occurring
on connection phase.
Processor to process IOEvent,
occurring on connection phase.public void setProcessor(Processor processor)
Processor to process IOEvent, occurring
on connection phase.
processor - the default Processor to process
IOEvent, occurring on connection phase.public ProcessorSelector getProcessorSelector()
ProcessorSelector, which will be used to get
Processor to process I/O events, occurring on connection phase.
ProcessorSelector, which will be used to get
Processor to process I/O events, occurring on connection phase.public void setProcessorSelector(ProcessorSelector processorSelector)
ProcessorSelector, which will be used to get
Processor to process I/O events, occurring on connection phase.
processorSelector - the default ProcessorSelector,
which will be used to get Processor to process I/O events,
occurring on connection phase.public void addMonitoringProbe(ConnectionProbe probe)
ConnectionProbe, which will be notified about
Connection life-cycle events.
probe - the ConnectionProbe.public boolean removeMonitoringProbe(ConnectionProbe probe)
ConnectionProbe.
probe - the ConnectionProbe.public ConnectionProbe[] getMonitoringProbes()
ConnectionProbe, which are registered on the Connection.
Please note, it's not appropriate to modify the returned array's content.
Please use addMonitoringProbe(org.glassfish.grizzly.ConnectionProbe) and
removeMonitoringProbe(org.glassfish.grizzly.ConnectionProbe) instead.
ConnectionProbe, which are registered on the Connection.protected void preConfigure(Connection connection)
Connection object before actual connecting phase
will be started.
connection - Connection to pre-configure.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||