Class JettyHTTPServerEngine

  • All Implemented Interfaces:
    ServerEngine, org.apache.cxf.transport.http.HttpServerEngineSupport
    Direct Known Subclasses:
    JettyHTTPServerEngineBeanDefinitionParser.SpringJettyHTTPServerEngine

    public class JettyHTTPServerEngine
    extends Object
    implements ServerEngine, org.apache.cxf.transport.http.HttpServerEngineSupport
    This class is the Jetty HTTP Server Engine that is configured to work off of a designated port. The port will be enabled for "http" or "https" depending upon its successful configuration.
    • Constructor Detail

      • JettyHTTPServerEngine

        public JettyHTTPServerEngine​(org.eclipse.jetty.util.component.Container.Listener mBeanContainer,
                                     String host,
                                     int port)
        This constructor is called by the JettyHTTPServerEngineFactory.
      • JettyHTTPServerEngine

        public JettyHTTPServerEngine()
    • Method Detail

      • setThreadPool

        public void setThreadPool​(org.eclipse.jetty.util.thread.ThreadPool p)
      • setPort

        public void setPort​(int p)
      • setHost

        public void setHost​(String host)
      • setContinuationsEnabled

        public void setContinuationsEnabled​(boolean enabled)
      • getContinuationsEnabled

        public boolean getContinuationsEnabled()
      • getProtocol

        public String getProtocol()
        Returns the protocol "http" or "https" for which this engine was configured.
      • getPort

        public int getPort()
        Returns the port number for which this server engine was configured.
        Returns:
      • getHost

        public String getHost()
        Returns the host for which this server engine was configured.
        Returns:
      • shutdown

        public void shutdown()
        This method will shut down the server engine and remove it from the factory's cache.
      • getServer

        public org.eclipse.jetty.server.Server getServer()
        get the jetty server instance
        Returns:
      • setServer

        public void setServer​(org.eclipse.jetty.server.Server s)
        Set the jetty server instance
        Parameters:
        s -
      • setConnector

        public void setConnector​(org.eclipse.jetty.server.Connector c)
        set the jetty server's connector
        Parameters:
        c -
      • setHandlers

        public void setHandlers​(List<org.eclipse.jetty.server.Handler> h)
        set the jetty server's handlers
        Parameters:
        h -
      • setSessionSupport

        public void setSessionSupport​(boolean support)
      • isSessionSupport

        public boolean isSessionSupport()
      • getHandlers

        public List<org.eclipse.jetty.server.Handler> getHandlers()
      • getConnector

        public org.eclipse.jetty.server.Connector getConnector()
      • isReuseAddress

        public boolean isReuseAddress()
      • setReuseAddress

        public void setReuseAddress​(boolean reuse)
      • getMaxIdleTime

        public int getMaxIdleTime()
      • setMaxIdleTime

        public void setMaxIdleTime​(int maxIdle)
      • checkRegistedContext

        protected void checkRegistedContext​(URL url)
      • addServant

        public void addServant​(URL url,
                               JettyHTTPHandler handler)
        Register a servant.
        Specified by:
        addServant in interface ServerEngine
        Parameters:
        url - the URL associated with the servant
        handler - notified on incoming HTTP requests
      • createSSLContext

        protected SSLContext createSSLContext​(org.eclipse.jetty.util.ssl.SslContextFactory scf)
                                       throws Exception
        Throws:
        Exception
      • detectProto

        protected static String detectProto​(String proto,
                                            boolean allowSSLv3)
      • setClientAuthentication

        protected void setClientAuthentication​(org.eclipse.jetty.util.ssl.SslContextFactory.Server con,
                                               org.apache.cxf.configuration.security.ClientAuthentication clientAuth)
      • setupThreadPool

        protected void setupThreadPool()
      • removeServant

        public void removeServant​(URL url)
        Remove a previously registered servant.
        Specified by:
        removeServant in interface ServerEngine
        Parameters:
        url - the URL the servant was registered against.
      • getServant

        public org.eclipse.jetty.server.Handler getServant​(URL url)
        Get a registered servant.
        Specified by:
        getServant in interface ServerEngine
        Parameters:
        url - the associated URL
        Returns:
        the HttpHandler if registered
      • getContextHandler

        public org.eclipse.jetty.server.handler.ContextHandler getContextHandler​(URL url)
        Get a registered context handler.
        Parameters:
        url - the associated URL
        Returns:
        the HttpHandler if registered
      • retrieveListenerFactory

        protected void retrieveListenerFactory()
      • finalizeConfig

        @PostConstruct
        public void finalizeConfig()
        This method is called after configure on this object.
      • stop

        protected void stop()
                     throws Exception
        This method is called by the ServerEngine Factory to destroy the listener.
        Throws:
        Exception
      • setTlsServerParameters

        public void setTlsServerParameters​(org.apache.cxf.configuration.jsse.TLSServerParameters params)
        This method is used to programmatically set the TLSServerParameters. This method may only be called by the factory.
        Throws:
        IOException
      • getTlsServerParameters

        public org.apache.cxf.configuration.jsse.TLSServerParameters getTlsServerParameters()
        This method returns the programmatically set TLSServerParameters, not the TLSServerParametersType, which is the JAXB generated type used in SpringConfiguration.
        Returns:
      • setThreadingParameters

        public void setThreadingParameters​(ThreadingParameters params)
        This method sets the threading parameters for this particular server engine. This method may only be called by the factory.
      • isSetThreadingParameters

        public boolean isSetThreadingParameters()
        This method returns whether the threading parameters are set.
      • getThreadingParameters

        public ThreadingParameters getThreadingParameters()
        This method returns the threading parameters that have been set. This method may return null, if the threading parameters have not been set.
      • setSendServerVersion

        public void setSendServerVersion​(Boolean sendServerVersion)
      • getSendServerVersion

        public Boolean getSendServerVersion()
      • getSessionTimeout

        public int getSessionTimeout()
      • setSessionTimeout

        public void setSessionTimeout​(int sessionTimeout)