Class 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.
    • Field Detail


        public static java.lang.String PORT_SYSPROPERTY

        public static final java.lang.String DEFAULT_PORT_STR
    • Constructor Detail

      • MavenServerConnector

        public MavenServerConnector()
    • 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)
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Starts the managed lifecycle beans in the order they were added.
        doStart in class ContainerLifeCycle
        AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
        java.lang.Exception - If there was a problem starting. Will cause a transition to FAILED state
      • 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.
        doStop in class ContainerLifeCycle
        java.lang.Exception - If there was a problem stopping. Will cause a transition to FAILED state
      • shutdown

        public java.util.concurrent.CompletableFuture<java.lang.Void> shutdown()
        Description copied from interface: Graceful
        Shutdown the component. When this method returns, the component should not accept any new load.
        Specified by:
        shutdown in interface Graceful
        A future that is completed once all load on the component is completed
      • getExecutor

        public java.util.concurrent.Executor getExecutor()
        Specified by:
        getExecutor in interface Connector
        the Executor used to submit tasks
      • getConnectionFactory

        public <T> T getConnectionFactory​(java.lang.Class<T> factoryType)
        Specified by:
        getConnectionFactory in interface Connector
      • getProtocols

        public java.util.List<java.lang.String> getProtocols()
        Specified by:
        getProtocols in interface Connector
      • getIdleTimeout

        @ManagedAttribute("maximum time a connection can be idle before being closed (in ms)")
        public long getIdleTimeout()
        Specified by:
        getIdleTimeout in interface Connector
        the max idle timeout for connections in milliseconds
      • getTransport

        public java.lang.Object getTransport()
        Specified by:
        getTransport in interface Connector
        the underlying socket, channel, buffer etc. for the connector.
      • getConnectedEndPoints

        public java.util.Collection<EndPoint> getConnectedEndPoints()
        Specified by:
        getConnectedEndPoints in interface Connector
        immutable collection of connected endpoints
      • 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 interface Connector
        The connector name or null.
      • getLocalPort

        public int getLocalPort()