@ManagedObject(value="AbstractNetworkConnector") public abstract class AbstractNetworkConnector extends AbstractConnector implements NetworkConnector
Extends the AbstractConnector
support for the NetworkConnector
interface.
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Container.InheritedListener, Container.Listener
LOG
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() |
protected void |
doStop() |
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, setName
addBean, 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, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isOpen
getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, getTransport
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
public 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 NetworkConnector
public 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 NetworkConnector
public int getLocalPort()
getLocalPort
in interface NetworkConnector
protected void doStart() throws Exception
doStart
in class AbstractConnector
Exception
protected void doStop() throws Exception
doStop
in class AbstractConnector
Exception
public void open() throws IOException
NetworkConnector
Performs the activities needed to open the network communication (for example, to start accepting incoming network connections).
open
in interface NetworkConnector
IOException
- if this connector cannot be openedNetworkConnector.close()
public void close()
NetworkConnector
Performs 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 Closeable
close
in interface AutoCloseable
close
in interface NetworkConnector
public Future<Void> shutdown()
shutdown
in interface Graceful
shutdown
in class AbstractConnector
protected boolean isAccepting()
isAccepting
in class AbstractConnector
public String toString()
toString
in class AbstractConnector
Copyright © 1995-2016 Webtide. All Rights Reserved.