@ManagedObject(value="AbstractNetworkConnector") public abstract class AbstractNetworkConnector extends AbstractConnector implements NetworkConnector
Extends the AbstractConnector support for the NetworkConnector interface.
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.ListenerContainer.InheritedListener, Container.ListenerLOG| Constructor and Description |
|---|
AbstractNetworkConnector(Server server,
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()
Starts the managed lifecycle beans in the order they were added.
|
protected void |
doStop()
Stops the managed lifecycle beans in the reverse order they were added.
|
String |
getHost() |
int |
getLocalPort() |
int |
getPort() |
protected boolean |
isAccepting() |
void |
open()
Performs the activities needed to open the network communication
(for example, to start accepting incoming network connections).
|
void |
setHost(String host) |
void |
setPort(int port) |
Future<Void> |
shutdown() |
String |
toString() |
accept, addConnectionFactory, clearConnectionFactories, getAcceptorPriorityDelta, getAcceptors, getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getDefaultProtocol, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, interruptAcceptors, join, join, onEndPointClosed, onEndPointOpened, removeConnectionFactory, setAcceptorPriorityDelta, setConnectionFactories, setDefaultProtocol, setIdleTimeout, setNameaddBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisOpengetByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, getTransportaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stoppublic AbstractNetworkConnector(Server server, Executor executor, Scheduler scheduler, ByteBufferPool pool, int acceptors, ConnectionFactory... factories)
public void setHost(String host)
@ManagedAttribute(value="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 String getHost()
getHost in interface NetworkConnectorpublic void setPort(int port)
@ManagedAttribute(value="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 Exception
ContainerLifeCycledoStart in class AbstractConnectorExceptionprotected void doStop()
throws Exception
ContainerLifeCycledoStop in class AbstractConnectorExceptionpublic void open()
throws IOException
NetworkConnectorPerforms the activities needed to open the network communication (for example, to start accepting incoming network connections).
open in interface NetworkConnectorIOException - 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 Closeableclose in interface AutoCloseableclose in interface NetworkConnectorpublic Future<Void> shutdown()
shutdown in interface Gracefulshutdown in class AbstractConnectorprotected boolean isAccepting()
isAccepting in class AbstractConnectorpublic String toString()
toString in class AbstractConnectorCopyright © 1995-2015 Webtide. All Rights Reserved.