java.io.Closeable, java.lang.AutoCloseable, Connector, NetworkConnector, Container, Destroyable, Dumpable, Graceful, LifeCycleServerConnector@ManagedObject("AbstractNetworkConnector") public abstract class AbstractNetworkConnector extends AbstractConnector implements NetworkConnector
Extends the AbstractConnector support for the NetworkConnector interface.
AbstractLifeCycle.AbstractLifeCycleListenerContainer.InheritedListener, Container.ListenerLifeCycle.ListenerLOGFAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING| Constructor | Description |
|---|---|
AbstractNetworkConnector(Server server,
java.util.concurrent.Executor executor,
Scheduler scheduler,
ByteBufferPool pool,
int acceptors,
ConnectionFactory... factories) |
| Modifier and Type | Method | 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, setNameaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopgetByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, getTransportaddBean, addBean, addEventListener, getBean, getBeans, getBeans, getContainedBeans, isManaged, manage, removeBean, removeEventListener, unmanageaddBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stopisOpenpublic AbstractNetworkConnector(Server server, java.util.concurrent.Executor executor, Scheduler scheduler, ByteBufferPool pool, int acceptors, ConnectionFactory... factories)
public void setHost(java.lang.String host)
@ManagedAttribute("The network interface this connector binds to as an IP address or a hostname. If null or 0.0.0.0, then bind to all interfaces.") public java.lang.String getHost()
getHost in interface NetworkConnectorpublic void setPort(int port)
@ManagedAttribute("Port this connector listens on. If set the 0 a random port is assigned which may be obtained with getLocalPort()") 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 callingLifeCycle.stop() and it will not be active again until a subsequent call to LifeCycle.start()close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in interface NetworkConnectorpublic java.util.concurrent.Future<java.lang.Void> shutdown()
shutdown in interface Gracefulshutdown in class AbstractConnectorprotected boolean handleAcceptFailure(java.lang.Throwable ex)
handleAcceptFailure in class AbstractConnectorpublic java.lang.String toString()
toString in class AbstractConnectorCopyright © 1995–2018 Webtide. All rights reserved.