Package org.eclipse.jetty.maven.plugin
Class MavenServerConnector
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.maven.plugin.MavenServerConnector
-
- All Implemented Interfaces:
Connector
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,Graceful
,LifeCycle
public class MavenServerConnector extends ContainerLifeCycle implements Connector
MavenServerConnector As the ServerConnector class does not have a no-arg constructor, and moreover requires the server instance passed in to all its constructors, it cannot be referenced in the pom.xml. This class wraps a ServerConnector, delaying setting the server instance. Only a few of the setters from the ServerConnector class are supported.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful
Graceful.Shutdown
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_IDLE_TIME
static int
DEFAULT_PORT
static java.lang.String
DEFAULT_PORT_STR
static java.lang.String
PORT_SYSPROPERTY
-
Constructor Summary
Constructors Constructor Description MavenServerConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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 socketsjava.util.concurrent.Future<java.lang.Void>
shutdown()
-
Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
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
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Container
addBean, addBean, addEventListener, getBean, getBeans, getBeans, getContainedBeans, isManaged, manage, removeBean, removeEventListener, unmanage
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Field Detail
-
PORT_SYSPROPERTY
public static java.lang.String PORT_SYSPROPERTY
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
DEFAULT_PORT_STR
public static final java.lang.String DEFAULT_PORT_STR
-
DEFAULT_MAX_IDLE_TIME
public static final int DEFAULT_MAX_IDLE_TIME
- See Also:
- Constant Field Values
-
-
Method Detail
-
setServer
public void setServer(Server server)
-
setHost
public void setHost(java.lang.String host)
-
getHost
public java.lang.String getHost()
-
setPort
public void setPort(int port)
-
getPort
public int getPort()
-
setName
public void setName(java.lang.String name)
-
setIdleTimeout
public void setIdleTimeout(long idleTimeout)
-
setSoLingerTime
@Deprecated public void setSoLingerTime(int lingerTime)
Deprecated.don't use as socket close linger time has undefined behavior for non-blocking sockets- Parameters:
lingerTime
- the socket close linger time
-
doStart
protected void doStart() throws java.lang.Exception
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in classContainerLifeCycle
- Throws:
java.lang.Exception
-
doStop
protected void doStop() throws java.lang.Exception
Description copied from class:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classContainerLifeCycle
- Throws:
java.lang.Exception
-
shutdown
public java.util.concurrent.Future<java.lang.Void> shutdown()
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfaceGraceful
-
getServer
public Server getServer()
-
getExecutor
public java.util.concurrent.Executor getExecutor()
- Specified by:
getExecutor
in interfaceConnector
- Returns:
- the
Executor
used to submit tasks
-
getScheduler
public Scheduler getScheduler()
- Specified by:
getScheduler
in interfaceConnector
- Returns:
- the
Scheduler
used to schedule tasks - See Also:
Connector.getScheduler()
-
getByteBufferPool
public ByteBufferPool getByteBufferPool()
- Specified by:
getByteBufferPool
in interfaceConnector
- Returns:
- the
ByteBufferPool
to acquire buffers from and release buffers to - See Also:
Connector.getByteBufferPool()
-
getConnectionFactory
public ConnectionFactory getConnectionFactory(java.lang.String nextProtocol)
- Specified by:
getConnectionFactory
in interfaceConnector
- Parameters:
nextProtocol
- the next protocol- Returns:
- the
ConnectionFactory
associated with the protocol name - See Also:
Connector.getConnectionFactory(java.lang.String)
-
getConnectionFactory
public <T> T getConnectionFactory(java.lang.Class<T> factoryType)
- Specified by:
getConnectionFactory
in interfaceConnector
- See Also:
Connector.getConnectionFactory(java.lang.Class)
-
getDefaultConnectionFactory
public ConnectionFactory getDefaultConnectionFactory()
- Specified by:
getDefaultConnectionFactory
in interfaceConnector
- Returns:
- the default
ConnectionFactory
associated with the default protocol name - See Also:
Connector.getDefaultConnectionFactory()
-
getConnectionFactories
public java.util.Collection<ConnectionFactory> getConnectionFactories()
- Specified by:
getConnectionFactories
in interfaceConnector
- See Also:
Connector.getConnectionFactories()
-
getProtocols
public java.util.List<java.lang.String> getProtocols()
- Specified by:
getProtocols
in interfaceConnector
- See Also:
Connector.getProtocols()
-
getIdleTimeout
@ManagedAttribute("maximum time a connection can be idle before being closed (in ms)") public long getIdleTimeout()
- Specified by:
getIdleTimeout
in interfaceConnector
- Returns:
- the max idle timeout for connections in milliseconds
- See Also:
Connector.getIdleTimeout()
-
getTransport
public java.lang.Object getTransport()
- Specified by:
getTransport
in interfaceConnector
- Returns:
- the underlying socket, channel, buffer etc. for the connector.
- See Also:
Connector.getTransport()
-
getConnectedEndPoints
public java.util.Collection<EndPoint> getConnectedEndPoints()
- Specified by:
getConnectedEndPoints
in interfaceConnector
- Returns:
- immutable collection of connected endpoints
- See Also:
Connector.getConnectedEndPoints()
-
getName
public java.lang.String getName()
Description copied from interface:Connector
Get the connector name if set.A
ContextHandler
may be configured with virtual hosts in the form "@connectorName" and will only serve requests from the named connector.- Specified by:
getName
in interfaceConnector
- Returns:
- The connector name or null.
- See Also:
Connector.getName()
-
getLocalPort
public int getLocalPort()
-
-