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 intDEFAULT_MAX_IDLE_TIMEstatic intDEFAULT_PORTstatic java.lang.StringDEFAULT_PORT_STRstatic java.lang.StringPORT_SYSPROPERTY
-
Constructor Summary
Constructors Constructor Description MavenServerConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voiddoStart()Starts the managed lifecycle beans in the order they were added.protected voiddoStop()Stops the managed lifecycle beans in the reverse order they were added.ByteBufferPoolgetByteBufferPool()java.util.Collection<EndPoint>getConnectedEndPoints()java.util.Collection<ConnectionFactory>getConnectionFactories()<T> TgetConnectionFactory(java.lang.Class<T> factoryType)ConnectionFactorygetConnectionFactory(java.lang.String nextProtocol)ConnectionFactorygetDefaultConnectionFactory()java.util.concurrent.ExecutorgetExecutor()java.lang.StringgetHost()longgetIdleTimeout()intgetLocalPort()java.lang.StringgetName()Get the connector name if set.intgetPort()java.util.List<java.lang.String>getProtocols()SchedulergetScheduler()ServergetServer()java.lang.ObjectgetTransport()booleanisShutdown()voidsetHost(java.lang.String host)voidsetIdleTimeout(long idleTimeout)voidsetName(java.lang.String name)voidsetPort(int port)voidsetServer(Server server)voidsetSoLingerTime(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.ExceptionDescription copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classContainerLifeCycle- Throws:
java.lang.Exception
-
doStop
protected void doStop() throws java.lang.ExceptionDescription copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStopin classContainerLifeCycle- Throws:
java.lang.Exception
-
shutdown
public java.util.concurrent.Future<java.lang.Void> shutdown()
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin interfaceGraceful
-
getServer
public Server getServer()
-
getExecutor
public java.util.concurrent.Executor getExecutor()
- Specified by:
getExecutorin interfaceConnector- Returns:
- the
Executorused to submit tasks
-
getScheduler
public Scheduler getScheduler()
- Specified by:
getSchedulerin interfaceConnector- Returns:
- the
Schedulerused to schedule tasks - See Also:
Connector.getScheduler()
-
getByteBufferPool
public ByteBufferPool getByteBufferPool()
- Specified by:
getByteBufferPoolin interfaceConnector- Returns:
- the
ByteBufferPoolto acquire buffers from and release buffers to - See Also:
Connector.getByteBufferPool()
-
getConnectionFactory
public ConnectionFactory getConnectionFactory(java.lang.String nextProtocol)
- Specified by:
getConnectionFactoryin interfaceConnector- Parameters:
nextProtocol- the next protocol- Returns:
- the
ConnectionFactoryassociated with the protocol name - See Also:
Connector.getConnectionFactory(java.lang.String)
-
getConnectionFactory
public <T> T getConnectionFactory(java.lang.Class<T> factoryType)
- Specified by:
getConnectionFactoryin interfaceConnector- See Also:
Connector.getConnectionFactory(java.lang.Class)
-
getDefaultConnectionFactory
public ConnectionFactory getDefaultConnectionFactory()
- Specified by:
getDefaultConnectionFactoryin interfaceConnector- Returns:
- the default
ConnectionFactoryassociated with the default protocol name - See Also:
Connector.getDefaultConnectionFactory()
-
getConnectionFactories
public java.util.Collection<ConnectionFactory> getConnectionFactories()
- Specified by:
getConnectionFactoriesin interfaceConnector- See Also:
Connector.getConnectionFactories()
-
getProtocols
public java.util.List<java.lang.String> getProtocols()
- Specified by:
getProtocolsin interfaceConnector- See Also:
Connector.getProtocols()
-
getIdleTimeout
@ManagedAttribute("maximum time a connection can be idle before being closed (in ms)") public long getIdleTimeout()
- Specified by:
getIdleTimeoutin interfaceConnector- Returns:
- the max idle timeout for connections in milliseconds
- See Also:
Connector.getIdleTimeout()
-
getTransport
public java.lang.Object getTransport()
- Specified by:
getTransportin interfaceConnector- Returns:
- the underlying socket, channel, buffer etc. for the connector.
- See Also:
Connector.getTransport()
-
getConnectedEndPoints
public java.util.Collection<EndPoint> getConnectedEndPoints()
- Specified by:
getConnectedEndPointsin interfaceConnector- Returns:
- immutable collection of connected endpoints
- See Also:
Connector.getConnectedEndPoints()
-
getName
public java.lang.String getName()
Description copied from interface:ConnectorGet the connector name if set.A
ContextHandlermay be configured with virtual hosts in the form "@connectorName" and will only serve requests from the named connector.- Specified by:
getNamein interfaceConnector- Returns:
- The connector name or null.
- See Also:
Connector.getName()
-
getLocalPort
public int getLocalPort()
-
-