public abstract class AbstractSocketConnectorHandler extends Object implements SocketConnectorHandler
SocketConnectorHandler
interface by pre-implementing some of its methods.| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractSocketConnectorHandler.Builder<E extends AbstractSocketConnectorHandler.Builder>
Builder
|
| Modifier and Type | Field and Description |
|---|---|
protected List<ConnectionProbe> |
probes |
protected Transport |
transport |
DEFAULT_CONNECTION_TIMEOUT| Constructor and Description |
|---|
AbstractSocketConnectorHandler(Transport transport) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMonitoringProbe(ConnectionProbe probe)
Add the
ConnectionProbe, which will be notified about
Connection life-cycle events. |
GrizzlyFuture<Connection> |
connect(SocketAddress remoteAddress)
Creates, initializes and establishes
Connection to the specific
remoteAddress. |
void |
connect(SocketAddress remoteAddress,
CompletionHandler<Connection> completionHandler)
Creates, initializes and establishes
Connection to the specific
remoteAddress. |
GrizzlyFuture<Connection> |
connect(SocketAddress remoteAddress,
SocketAddress localAddress)
Creates, initializes
Connection, binds it to the specific local
and remote remoteAddress. |
void |
connect(SocketAddress remoteAddress,
SocketAddress localAddress,
CompletionHandler<Connection> completionHandler)
Creates, initializes
Connection, binds it to the specific local
and remote remoteAddress. |
GrizzlyFuture<Connection> |
connect(String host,
int port)
Creates, initializes and connects socket to the specific remote host
and port and returns
Connection, representing socket. |
protected abstract FutureImpl<Connection> |
connectAsync(SocketAddress remoteAddress,
SocketAddress localAddress,
CompletionHandler<Connection> completionHandler,
boolean needFuture) |
ConnectionProbe[] |
getMonitoringProbes()
Get the
ConnectionProbe, which are registered on the Connection. |
Processor |
getProcessor()
|
ProcessorSelector |
getProcessorSelector()
Gets the default
ProcessorSelector, which will be used to get
Processor to process I/O events, occurring on connection phase. |
protected FutureImpl<Connection> |
makeCancellableFuture(Connection connection) |
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)
|
void |
setProcessorSelector(ProcessorSelector processorSelector)
Sets the default
ProcessorSelector, which will be used to get
Processor to process I/O events, occurring on connection phase. |
protected final Transport transport
protected final List<ConnectionProbe> probes
public AbstractSocketConnectorHandler(Transport transport)
public GrizzlyFuture<Connection> connect(String host, int port)
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.public GrizzlyFuture<Connection> connect(SocketAddress remoteAddress)
ConnectorHandlerConnection to the specific
remoteAddress.connect in interface ConnectorHandler<SocketAddress>remoteAddress - remote address to connect toFuture of connect operation, which could be used to get
resulting Connectionpublic void connect(SocketAddress remoteAddress, CompletionHandler<Connection> completionHandler)
ConnectorHandlerConnection to the specific
remoteAddress.connect in interface ConnectorHandler<SocketAddress>remoteAddress - remote address to connect tocompletionHandler - CompletionHandlerpublic GrizzlyFuture<Connection> connect(SocketAddress remoteAddress, SocketAddress localAddress)
ConnectorHandlerConnection, binds it to the specific local
and remote remoteAddress.connect in interface ConnectorHandler<SocketAddress>remoteAddress - remote address to connect tolocalAddress - local address to bind a Connection toFuture of connect operation, which could be used to get
resulting Connectionpublic void connect(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler)
ConnectorHandlerConnection, binds it to the specific local
and remote remoteAddress.connect in interface ConnectorHandler<SocketAddress>remoteAddress - remote address to connect tolocalAddress - local address to bind a Connection tocompletionHandler - CompletionHandlerprotected abstract FutureImpl<Connection> connectAsync(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection> completionHandler, boolean needFuture)
public Processor getProcessor()
public void setProcessor(Processor processor)
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.protected FutureImpl<Connection> makeCancellableFuture(Connection connection)
Copyright © 2014 Oracle Corporation. All Rights Reserved.