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.StopException
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, Graceful.ThrowingRunnable
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final String
static String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.<T> T
getConnectionFactory
(Class<T> factoryType) getConnectionFactory
(String nextProtocol) getHost()
long
int
getName()
Get the connector name if set.int
getPort()
boolean
void
void
setIdleTimeout
(long idleTimeout) void
void
setPort
(int port) void
shutdown()
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, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, 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, getCachedBeans, getContainedBeans, getEventListeners, 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
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:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in 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:ContainerLifeCycle
Stops the managed lifecycle beans in the reverse order they were added.- Overrides:
doStop
in classContainerLifeCycle
- Throws:
Exception
- If there was a problem stopping. Will cause a transition to FAILED state
-
shutdown
Description copied from interface:Graceful
Shutdown the component. When this method returns, the component should not accept any new load. -
isShutdown
public boolean isShutdown()- Specified by:
isShutdown
in interfaceGraceful
- Returns:
- True if
Graceful.shutdown()
has been called.
-
getServer
-
getExecutor
- Specified by:
getExecutor
in interfaceConnector
- Returns:
- the
Executor
used to submit tasks
-
getScheduler
- Specified by:
getScheduler
in interfaceConnector
- Returns:
- the
Scheduler
used to schedule tasks
-
getByteBufferPool
- Specified by:
getByteBufferPool
in interfaceConnector
- Returns:
- the
ByteBufferPool
to acquire buffers from and release buffers to
-
getConnectionFactory
- Specified by:
getConnectionFactory
in interfaceConnector
- Parameters:
nextProtocol
- the next protocol- Returns:
- the
ConnectionFactory
associated with the protocol name
-
getConnectionFactory
- Specified by:
getConnectionFactory
in interfaceConnector
-
getDefaultConnectionFactory
- Specified by:
getDefaultConnectionFactory
in interfaceConnector
- Returns:
- the default
ConnectionFactory
associated with the default protocol name
-
getConnectionFactories
- Specified by:
getConnectionFactories
in interfaceConnector
-
getProtocols
- Specified by:
getProtocols
in interfaceConnector
-
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
-
getTransport
- Specified by:
getTransport
in interfaceConnector
- Returns:
- the underlying socket, channel, buffer etc. for the connector.
-
getConnectedEndPoints
- Specified by:
getConnectedEndPoints
in interfaceConnector
- Returns:
- immutable collection of connected endpoints
-
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. -
getLocalPort
public int getLocalPort()
-