public abstract class AbstractNetworkConnector extends AbstractConnector implements NetworkConnector
Extends the AbstractConnector support for the NetworkConnector interface.
LOG| Constructor and Description |
|---|
AbstractNetworkConnector(Server server,
java.util.concurrent.Executor executor,
Scheduler scheduler,
ByteBufferPool pool,
int acceptors,
ConnectionFactory... factories) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Performs the activities needed to close the network communication
(for example, to stop accepting network connections).
|
protected void |
doStart() |
protected void |
doStop() |
java.lang.String |
getHost() |
int |
getLocalPort() |
int |
getPort() |
protected boolean |
handleAcceptFailure(java.lang.Throwable ex) |
void |
open()
Performs the activities needed to open the network communication
(for example, to start accepting incoming network connections).
|
void |
setHost(java.lang.String host) |
void |
setPort(int port) |
java.util.concurrent.Future<java.lang.Void> |
shutdown() |
java.lang.String |
toString() |
accept, addConnectionFactory, addFirstConnectionFactory, addIfAbsentConnectionFactory, clearConnectionFactories, getAcceptorPriorityDelta, getAcceptors, getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getDefaultProtocol, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, interruptAcceptors, isAccepting, join, join, onEndPointClosed, onEndPointOpened, removeConnectionFactory, setAccepting, setAcceptorPriorityDelta, setConnectionFactories, setDefaultProtocol, setIdleTimeout, setNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisOpengetByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, getTransportpublic AbstractNetworkConnector(Server server, java.util.concurrent.Executor executor, Scheduler scheduler, ByteBufferPool pool, int acceptors, ConnectionFactory... factories)
public void setHost(java.lang.String host)
public java.lang.String getHost()
getHost in interface NetworkConnectorpublic void setPort(int port)
public int getPort()
getPort in interface NetworkConnectorpublic int getLocalPort()
getLocalPort in interface NetworkConnectorprotected void doStart()
throws java.lang.Exception
doStart in class AbstractConnectorjava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
doStop in class AbstractConnectorjava.lang.Exceptionpublic void open()
throws java.io.IOException
NetworkConnectorPerforms the activities needed to open the network communication (for example, to start accepting incoming network connections).
open in interface NetworkConnectorjava.io.IOException - if this connector cannot be openedNetworkConnector.close()public void close()
NetworkConnectorPerforms the activities needed to close the network communication (for example, to stop accepting network connections).
Once a connector has been closed, it cannot be opened again without first calling#stop() and it will not be active again until a subsequent call to #start()close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface NetworkConnectorpublic java.util.concurrent.Future<java.lang.Void> shutdown()
shutdown in class AbstractConnectorprotected boolean handleAcceptFailure(java.lang.Throwable ex)
handleAcceptFailure in class AbstractConnectorpublic java.lang.String toString()
toString in class AbstractConnector