public class MavenServerConnector extends ContainerLifeCycle implements Connector
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Container.InheritedListener, Container.Listener
Graceful.Shutdown
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_IDLE_TIME |
static int |
DEFAULT_PORT |
static java.lang.String |
DEFAULT_PORT_STR |
private ServerConnector |
delegate |
private java.lang.String |
host |
private long |
idleTimeout |
private java.lang.String |
name |
private int |
port |
static java.lang.String |
PORT_SYSPROPERTY |
private Server |
server |
Constructor and Description |
---|
MavenServerConnector() |
Modifier and Type | Method and Description |
---|---|
private ServerConnector |
checkDelegate() |
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.
|
ByteBufferPool |
getByteBufferPool() |
java.util.Collection<EndPoint> |
getConnectedEndPoints() |
java.util.Collection<ConnectionFactory> |
getConnectionFactories() |
<T> T |
getConnectionFactory(java.lang.Class<T> factoryType) |
ConnectionFactory |
getConnectionFactory(java.lang.String nextProtocol) |
ConnectionFactory |
getDefaultConnectionFactory() |
java.util.concurrent.Executor |
getExecutor() |
java.lang.String |
getHost() |
long |
getIdleTimeout() |
int |
getLocalPort() |
java.lang.String |
getName()
Get the connector name if set.
|
int |
getPort() |
java.util.List<java.lang.String> |
getProtocols() |
Scheduler |
getScheduler() |
Server |
getServer() |
java.lang.Object |
getTransport() |
boolean |
isShutdown() |
void |
setHost(java.lang.String host) |
void |
setIdleTimeout(long idleTimeout) |
void |
setName(java.lang.String name) |
void |
setPort(int port) |
void |
setServer(Server server) |
void |
setSoLingerTime(int lingerTime)
Deprecated.
don't use as socket close linger time has undefined behavior for non-blocking sockets
|
java.util.concurrent.Future<java.lang.Void> |
shutdown() |
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stop
addBean, addBean, addEventListener, getBean, getBeans, getBeans, getContainedBeans, isManaged, manage, removeBean, removeEventListener, unmanage
dumpObjects, dumpSelf
public static java.lang.String PORT_SYSPROPERTY
public static final int DEFAULT_PORT
public static final java.lang.String DEFAULT_PORT_STR
public static final int DEFAULT_MAX_IDLE_TIME
private Server server
private volatile ServerConnector delegate
private java.lang.String host
private java.lang.String name
private int port
private long idleTimeout
public void setServer(Server server)
public void setHost(java.lang.String host)
public java.lang.String getHost()
public void setPort(int port)
public int getPort()
public void setName(java.lang.String name)
public void setIdleTimeout(long idleTimeout)
@Deprecated public void setSoLingerTime(int lingerTime)
lingerTime
- the socket close linger timeprotected void doStart() throws java.lang.Exception
ContainerLifeCycle
doStart
in class ContainerLifeCycle
java.lang.Exception
protected void doStop() throws java.lang.Exception
ContainerLifeCycle
doStop
in class ContainerLifeCycle
java.lang.Exception
public java.util.concurrent.Future<java.lang.Void> shutdown()
public boolean isShutdown()
isShutdown
in interface Graceful
public Server getServer()
public java.util.concurrent.Executor getExecutor()
getExecutor
in interface Connector
Executor
used to submit taskspublic Scheduler getScheduler()
getScheduler
in interface Connector
Scheduler
used to schedule tasksConnector.getScheduler()
public ByteBufferPool getByteBufferPool()
getByteBufferPool
in interface Connector
ByteBufferPool
to acquire buffers from and release buffers toConnector.getByteBufferPool()
public ConnectionFactory getConnectionFactory(java.lang.String nextProtocol)
getConnectionFactory
in interface Connector
nextProtocol
- the next protocolConnectionFactory
associated with the protocol nameConnector.getConnectionFactory(java.lang.String)
public <T> T getConnectionFactory(java.lang.Class<T> factoryType)
getConnectionFactory
in interface Connector
Connector.getConnectionFactory(java.lang.Class)
public ConnectionFactory getDefaultConnectionFactory()
getDefaultConnectionFactory
in interface Connector
ConnectionFactory
associated with the default protocol nameConnector.getDefaultConnectionFactory()
public java.util.Collection<ConnectionFactory> getConnectionFactories()
getConnectionFactories
in interface Connector
Connector.getConnectionFactories()
public java.util.List<java.lang.String> getProtocols()
getProtocols
in interface Connector
Connector.getProtocols()
@ManagedAttribute(value="maximum time a connection can be idle before being closed (in ms)") public long getIdleTimeout()
getIdleTimeout
in interface Connector
Connector.getIdleTimeout()
public java.lang.Object getTransport()
getTransport
in interface Connector
Connector.getTransport()
public java.util.Collection<EndPoint> getConnectedEndPoints()
getConnectedEndPoints
in interface Connector
Connector.getConnectedEndPoints()
public java.lang.String getName()
Connector
A ContextHandler
may be configured with
virtual hosts in the form "@connectorName" and will only serve
requests from the named connector.
getName
in interface Connector
Connector.getName()
public int getLocalPort()
private ServerConnector checkDelegate() throws java.lang.IllegalStateException
java.lang.IllegalStateException