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
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, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful
Graceful.Shutdown, Graceful.ThrowingRunnableNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final Stringstatic String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.<T> TgetConnectionFactory(Class<T> factoryType) getConnectionFactory(String nextProtocol) getHost()longintgetName()Get the connector name if set.intgetPort()booleanvoidvoidsetIdleTimeout(long idleTimeout) voidvoidsetPort(int port) voidshutdown()Shutdown the component.Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
addBean, addBean, addEventListener, getBean, getBeans, getBeans, getCachedBeans, getContainedBeans, getEventListeners, isManaged, manage, removeBean, removeEventListener, unmanageMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
-
Field Details
-
PORT_SYSPROPERTY
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_PORT_STR
-
DEFAULT_MAX_IDLE_TIME
public static final int DEFAULT_MAX_IDLE_TIME- See Also:
-
-
Constructor Details
-
MavenServerConnector
public MavenServerConnector()
-
-
Method Details
-
setServer
-
setHost
-
getHost
-
setPort
public void setPort(int port) -
getPort
public int getPort() -
setName
-
setIdleTimeout
public void setIdleTimeout(long idleTimeout) -
doStart
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classContainerLifeCycle- Throws:
AbstractLifeCycle.StopException- If thrown, the lifecycle will immediately be stopped.Exception- If there was a problem starting. Will cause a transition to FAILED state
-
doStop
Description copied from class:ContainerLifeCycleStops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStopin classContainerLifeCycle- Throws:
Exception- If there was a problem stopping. Will cause a transition to FAILED state
-
shutdown
Description copied from interface:GracefulShutdown the component. When this method returns, the component should not accept any new load. -
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceGraceful- Returns:
- True if
Graceful.shutdown()has been called.
-
getServer
-
getExecutor
- Specified by:
getExecutorin interfaceConnector- Returns:
- the
Executorused to submit tasks
-
getScheduler
- Specified by:
getSchedulerin interfaceConnector- Returns:
- the
Schedulerused to schedule tasks
-
getByteBufferPool
- Specified by:
getByteBufferPoolin interfaceConnector- Returns:
- the
ByteBufferPoolto acquire buffers from and release buffers to
-
getConnectionFactory
- Specified by:
getConnectionFactoryin interfaceConnector- Parameters:
nextProtocol- the next protocol- Returns:
- the
ConnectionFactoryassociated with the protocol name
-
getConnectionFactory
- Specified by:
getConnectionFactoryin interfaceConnector
-
getDefaultConnectionFactory
- Specified by:
getDefaultConnectionFactoryin interfaceConnector- Returns:
- the default
ConnectionFactoryassociated with the default protocol name
-
getConnectionFactories
- Specified by:
getConnectionFactoriesin interfaceConnector
-
getProtocols
- Specified by:
getProtocolsin interfaceConnector
-
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
-
getTransport
- Specified by:
getTransportin interfaceConnector- Returns:
- the underlying socket, channel, buffer etc. for the connector.
-
getConnectedEndPoints
- Specified by:
getConnectedEndPointsin interfaceConnector- Returns:
- immutable collection of connected endpoints
-
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. -
getLocalPort
public int getLocalPort()
-