Class JettyHTTPServerEngine
- java.lang.Object
-
- org.apache.cxf.transport.http_jetty.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.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DO_NOT_CHECK_URL_PROP
-
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 void
addServant(URL url, JettyHTTPHandler handler)
Register a servant.protected void
checkRegistedContext(URL url)
protected SSLContext
createSSLContext(org.eclipse.jetty.util.ssl.SslContextFactory scf)
protected static String
detectProto(String proto, boolean allowSSLv3)
void
finalizeConfig()
This method is called after configure on this object.org.eclipse.jetty.server.Connector
getConnector()
org.eclipse.jetty.server.handler.ContextHandler
getContextHandler(URL url)
Get a registered context handler.boolean
getContinuationsEnabled()
List<org.eclipse.jetty.server.Handler>
getHandlers()
String
getHost()
Returns the host for which this server engine was configured.int
getMaxIdleTime()
int
getPort()
Returns the port number for which this server engine was configured.String
getProtocol()
Returns the protocol "http" or "https" for which this engine was configured.Boolean
getSendServerVersion()
org.eclipse.jetty.server.Handler
getServant(URL url)
Get a registered servant.org.eclipse.jetty.server.Server
getServer()
get the jetty server instanceint
getSessionTimeout()
ThreadingParameters
getThreadingParameters()
This method returns the threading parameters that have been set.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.boolean
isReuseAddress()
boolean
isSessionSupport()
boolean
isSetThreadingParameters()
This method returns whether the threading parameters are set.void
removeServant(URL url)
Remove a previously registered servant.protected void
retrieveListenerFactory()
protected void
setClientAuthentication(org.eclipse.jetty.util.ssl.SslContextFactory.Server con, org.apache.cxf.configuration.security.ClientAuthentication clientAuth)
void
setConnector(org.eclipse.jetty.server.Connector c)
set the jetty server's connectorvoid
setContinuationsEnabled(boolean enabled)
void
setHandlers(List<org.eclipse.jetty.server.Handler> h)
set the jetty server's handlersvoid
setHost(String host)
void
setMaxIdleTime(int maxIdle)
void
setPort(int p)
void
setReuseAddress(boolean reuse)
void
setSendServerVersion(Boolean sendServerVersion)
void
setServer(org.eclipse.jetty.server.Server s)
Set the jetty server instancevoid
setSessionSupport(boolean support)
void
setSessionTimeout(int sessionTimeout)
void
setThreadingParameters(ThreadingParameters params)
This method sets the threading parameters for this particular server engine.void
setThreadPool(org.eclipse.jetty.util.thread.ThreadPool p)
void
setTlsServerParameters(org.apache.cxf.configuration.jsse.TLSServerParameters params)
This method is used to programmatically set the TLSServerParameters.protected void
setupThreadPool()
void
shutdown()
This method will shut down the server engine and remove it from the factory's cache.protected void
stop()
This method is called by the ServerEngine Factory to destroy the listener.
-
-
-
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:
addServant
in 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:
removeServant
in 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:
getServant
in 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 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)
-
-