Apache CXF API

org.apache.cxf.transport.http_jetty
Class JettyHTTPServerEngine

java.lang.Object
  extended by org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine
All Implemented Interfaces:
ServerEngine
Direct Known Subclasses:
JettyHTTPServerEngineBeanDefinitionParser.SpringJettyHTTPServerEngine

public class JettyHTTPServerEngine
extends Object
implements ServerEngine

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 Summary
JettyHTTPServerEngine()
           
JettyHTTPServerEngine(org.eclipse.jetty.util.component.Container.Listener mBeanContainer, String host, int port)
          This constructor is called by the JettyHTTPServerEngineFactory.
 
Method Summary
 void addServant(URL url, JettyHTTPHandler handler)
          Register a servant.
 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.
protected  JettyConnectorFactory getHTTPConnectorFactory()
          This method creates a connector factory.
protected  JettyConnectorFactory getHTTPSConnectorFactory(TLSServerParameters tlsParams)
          This method creates a connector factory enabled with the JSSE
 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.
 org.eclipse.jetty.server.Handler getServant(URL url)
          Get a registered servant.
 org.eclipse.jetty.server.Server getServer()
          get the jetty server instance
 ThreadingParameters getThreadingParameters()
          This method returns the threading parameters that have been set.
 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()
           
 void setConnector(org.eclipse.jetty.server.Connector c)
          set the jetty server's connector
 void setContinuationsEnabled(boolean enabled)
           
 void setHandlers(List<org.eclipse.jetty.server.Handler> h)
          set the jetty server's handlers
 void setHost(String host)
           
 void setMaxIdleTime(int maxIdle)
           
 void setPort(int p)
           
 void setReuseAddress(boolean reuse)
           
 void setServer(org.eclipse.jetty.server.Server s)
          Set the jetty server instance
 void setSessionSupport(boolean support)
           
 void setThreadingParameters(ThreadingParameters params)
          This method sets the threading parameters for this particular server engine.
 void setTlsServerParameters(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

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)

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

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()

getHTTPConnectorFactory

protected JettyConnectorFactory getHTTPConnectorFactory()
This method creates a connector factory. If there are TLS parameters then it creates a TLS enabled one.


getHTTPSConnectorFactory

protected JettyConnectorFactory getHTTPSConnectorFactory(TLSServerParameters tlsParams)
This method creates a connector factory enabled with the JSSE


finalizeConfig

@PostConstruct
public void finalizeConfig()
                    throws GeneralSecurityException,
                           IOException
This method is called after configure on this object.

Throws:
GeneralSecurityException
IOException

stop

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

Throws:
Exception

setTlsServerParameters

public void setTlsServerParameters(TLSServerParameters params)
                            throws IOException
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.


Apache CXF API

Apache CXF