Class JettyHTTPServerEngine
- java.lang.Object
-
- org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine
-
- All Implemented Interfaces:
ServerEngine,HttpServerEngineSupport
- Direct Known Subclasses:
JettyHTTPServerEngineBeanDefinitionParser.SpringJettyHTTPServerEngine
public class JettyHTTPServerEngine extends Object implements ServerEngine, 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.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDO_NOT_CHECK_URL_PROP-
Fields inherited from interface org.apache.cxf.transport.http.HttpServerEngineSupport
ENABLE_HTTP2
-
-
Constructor Summary
Constructors Constructor Description JettyHTTPServerEngine()JettyHTTPServerEngine(org.eclipse.jetty.util.component.Container.Listener mBeanContainer, String host, int port)This constructor is called by the JettyHTTPServerEngineFactory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddServant(URL url, JettyHTTPHandler handler)Register a servant.protected voidcheckRegistedContext(URL url)protected SSLContextcreateSSLContext(org.eclipse.jetty.util.ssl.SslContextFactory scf)protected static StringdetectProto(String proto, boolean allowSSLv3)voidfinalizeConfig()This method is called after configure on this object.org.eclipse.jetty.server.ConnectorgetConnector()org.eclipse.jetty.server.handler.ContextHandlergetContextHandler(URL url)Get a registered context handler.booleangetContinuationsEnabled()List<org.eclipse.jetty.server.Handler>getHandlers()StringgetHost()Returns the host for which this server engine was configured.intgetMaxIdleTime()intgetPort()Returns the port number for which this server engine was configured.StringgetProtocol()Returns the protocol "http" or "https" for which this engine was configured.BooleangetSendServerVersion()org.eclipse.jetty.server.HandlergetServant(URL url)Get a registered servant.org.eclipse.jetty.server.ServergetServer()get the jetty server instanceintgetSessionTimeout()ThreadingParametersgetThreadingParameters()This method returns the threading parameters that have been set.TLSServerParametersgetTlsServerParameters()This method returns the programmatically set TLSServerParameters, not the TLSServerParametersType, which is the JAXB generated type used in SpringConfiguration.booleanisReuseAddress()booleanisSessionSupport()booleanisSetThreadingParameters()This method returns whether the threading parameters are set.voidremoveServant(URL url)Remove a previously registered servant.protected voidretrieveListenerFactory()protected voidsetClientAuthentication(org.eclipse.jetty.util.ssl.SslContextFactory.Server con, org.apache.cxf.configuration.security.ClientAuthentication clientAuth)voidsetConnector(org.eclipse.jetty.server.Connector c)set the jetty server's connectorvoidsetContinuationsEnabled(boolean enabled)voidsetHandlers(List<org.eclipse.jetty.server.Handler> h)set the jetty server's handlersvoidsetHost(String host)voidsetMaxIdleTime(int maxIdle)voidsetPort(int p)voidsetReuseAddress(boolean reuse)voidsetSendServerVersion(Boolean sendServerVersion)voidsetServer(org.eclipse.jetty.server.Server s)Set the jetty server instancevoidsetSessionSupport(boolean support)voidsetSessionTimeout(int sessionTimeout)voidsetThreadingParameters(ThreadingParameters params)This method sets the threading parameters for this particular server engine.voidsetThreadPool(org.eclipse.jetty.util.thread.ThreadPool p)voidsetTlsServerParameters(TLSServerParameters params)This method is used to programmatically set the TLSServerParameters.protected voidsetupThreadPool()voidshutdown()This method will shut down the server engine and remove it from the factory's cache.protected voidstop()This method is called by the ServerEngine Factory to destroy the listener.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cxf.transport.http.HttpServerEngineSupport
isHttp2Enabled, isHttp2Required
-
-
-
-
Field Detail
-
DO_NOT_CHECK_URL_PROP
public static final String DO_NOT_CHECK_URL_PROP
- See Also:
- Constant Field Values
-
-
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:
addServantin interfaceServerEngine- Parameters:
url- the URL associated with the servanthandler- notified on incoming HTTP requests
-
createSSLContext
protected SSLContext createSSLContext(org.eclipse.jetty.util.ssl.SslContextFactory scf) throws Exception
- Throws:
Exception
-
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:
removeServantin interfaceServerEngine- 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:
getServantin interfaceServerEngine- 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 ExceptionThis method is called by the ServerEngine Factory to destroy the listener.- Throws:
Exception
-
setTlsServerParameters
public void setTlsServerParameters(TLSServerParameters params)
This method is used to programmatically set the TLSServerParameters. This method may only be called by the factory.- Throws:
IOException
-
getTlsServerParameters
public 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)
-
-