Interface NetworkConnector
- All Known Implementing Classes:
AbstractNetworkConnector, NetworkTrafficSelectChannelConnector, NetworkTrafficServerConnector, ServerConnector
-
Nested Class Summary
Nested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Graceful
Graceful.ShutdownNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Performs the activities needed to close the network communication (for example, to stop accepting network connections).getHost()intintgetPort()booleanisOpen()A Connector may be opened and not started (to reserve a port) or closed and running (to allow graceful shutdown of existing connections)voidopen()Performs the activities needed to open the network communication (for example, to start accepting incoming network connections).Methods inherited from interface Connector
getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getExecutor, getIdleTimeout, getName, getProtocols, getScheduler, getServer, getTransportMethods inherited from interface Container
addBean, addBean, addEventListener, getBean, getBeans, getBeans, getContainedBeans, isManaged, manage, removeBean, removeEventListener, unmanageMethods inherited from interface Graceful
isShutdown, shutdownMethods inherited from interface LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Method Details
-
open
Performs the activities needed to open the network communication (for example, to start accepting incoming network connections).
- Throws:
IOException- if this connector cannot be opened- See Also:
-
close
void close()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 toLifeCycle.start()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
isOpen
boolean isOpen()A Connector may be opened and not started (to reserve a port) or closed and running (to allow graceful shutdown of existing connections)- Returns:
- True if the connector is Open.
-
getHost
String getHost()- Returns:
- The hostname representing the interface to which this connector will bind, or null for all interfaces.
-
getPort
int getPort()- Returns:
- The configured port for the connector or 0 if any available port may be used.
-
getLocalPort
int getLocalPort()- Returns:
- The actual port the connector is listening on, or -1 if it has not been opened, or -2 if it has been closed.
-