org.apache.camel.component.jetty
Class JettyHttpComponent

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultComponent
          extended by org.apache.camel.impl.HeaderFilterStrategyComponent
              extended by org.apache.camel.component.http.HttpComponent
                  extended by org.apache.camel.component.jetty.JettyHttpComponent
All Implemented Interfaces:
CamelContextAware, Component, Service, ShutdownableService, HeaderFilterStrategyAware

public class JettyHttpComponent
extends HttpComponent

An HttpComponent which starts an embedded Jetty for to handle consuming from the http endpoints.

Version:

Field Summary
protected static HashMap<String,org.apache.camel.component.jetty.JettyHttpComponent.ConnectorRef> CONNECTORS
           
protected  Long continuationTimeout
           
protected  boolean enableJmx
           
protected  org.eclipse.jetty.client.HttpClient httpClient
           
protected  Integer httpClientMaxThreads
           
protected  Integer httpClientMinThreads
           
protected  org.eclipse.jetty.util.thread.ThreadPool httpClientThreadPool
           
protected  JettyHttpBinding jettyHttpBinding
           
protected  Integer maxThreads
           
protected  org.eclipse.jetty.jmx.MBeanContainer mbContainer
           
protected  Integer minThreads
           
protected  Map<String,Object> socketConnectorProperties
           
protected  Map<Integer,org.eclipse.jetty.server.nio.SelectChannelConnector> socketConnectors
           
protected  String sslKeyPassword
           
protected  String sslKeystore
           
protected  String sslPassword
           
protected  Map<String,Object> sslSocketConnectorProperties
           
protected  Map<Integer,org.eclipse.jetty.server.ssl.SslSelectChannelConnector> sslSocketConnectors
           
protected  org.eclipse.jetty.util.thread.ThreadPool threadPool
           
static String TMP_DIR
           
protected  boolean useContinuation
           
 
Fields inherited from class org.apache.camel.component.http.HttpComponent
httpBinding, httpClientConfigurer, httpConfiguration, httpConnectionManager
 
Constructor Summary
JettyHttpComponent()
           
 
Method Summary
 void addSocketConnectorProperty(String key, Object value)
           
 void addSslSocketConnectorProperty(String key, Object value)
           
 void connect(HttpConsumer consumer)
          Connects the URL specified on the endpoint to the specified processor.
protected  Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters)
          A factory method allowing derived components to create a new endpoint from the given URI, remaining path and optional parameters
protected  org.eclipse.jetty.server.Server createServer()
           
protected  CamelServlet createServletForConnector(org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.Connector connector, List<org.eclipse.jetty.server.Handler> handlers, JettyHttpEndpoint endpoint)
           
protected  org.eclipse.jetty.server.nio.SelectChannelConnector createSocketConnector()
           
protected  org.eclipse.jetty.server.ssl.SslSelectChannelConnector createSslSocketConnector()
           
 void disconnect(HttpConsumer consumer)
          Disconnects the URL specified on the endpoint from the specified processor.
protected  void doStart()
           
protected  void doStop()
           
 Long getContinuationTimeout()
           
 org.eclipse.jetty.client.HttpClient getHttpClient()
           
 Integer getHttpClientMaxThreads()
           
 Integer getHttpClientMinThreads()
           
 org.eclipse.jetty.util.thread.ThreadPool getHttpClientThreadPool()
           
 JettyHttpBinding getJettyHttpBinding()
           
 String getKeystore()
           
 Integer getMaxThreads()
           
 org.eclipse.jetty.jmx.MBeanContainer getMbContainer()
           
 Integer getMinThreads()
           
 org.eclipse.jetty.server.nio.SelectChannelConnector getSocketConnector(int port)
           
 Map<String,Object> getSocketConnectorProperties()
           
 String getSslKeyPassword()
           
 String getSslPassword()
           
protected  org.eclipse.jetty.server.ssl.SslSelectChannelConnector getSslSocketConnector(int port)
           
 Map<String,Object> getSslSocketConnectorProperties()
           
 Map<Integer,org.eclipse.jetty.server.ssl.SslSelectChannelConnector> getSslSocketConnectors()
           
 org.eclipse.jetty.util.thread.ThreadPool getThreadPool()
           
 boolean isEnableJmx()
           
 boolean isUseContinuation()
           
 void setContinuationTimeout(Long continuationTimeout)
           
 void setEnableJmx(boolean enableJmx)
           
 void setHttpClient(org.eclipse.jetty.client.HttpClient httpClient)
           
 void setHttpClientMaxThreads(Integer httpClientMaxThreads)
           
 void setHttpClientMinThreads(Integer httpClientMinThreads)
           
 void setHttpClientThreadPool(org.eclipse.jetty.util.thread.ThreadPool httpClientThreadPool)
           
 void setJettyHttpBinding(JettyHttpBinding jettyHttpBinding)
           
 void setKeystore(String sslKeystore)
           
 void setMaxThreads(Integer maxThreads)
           
 void setMbContainer(org.eclipse.jetty.jmx.MBeanContainer mbContainer)
           
 void setMinThreads(Integer minThreads)
           
 void setSocketConnectorProperties(Map<String,Object> socketConnectorProperties)
           
 void setSocketConnectors(Map<Integer,org.eclipse.jetty.server.nio.SelectChannelConnector> socketConnectors)
           
 void setSslKeyPassword(String sslKeyPassword)
           
 void setSslPassword(String sslPassword)
           
 void setSslSocketConnectorProperties(Map<String,Object> sslSocketConnectorProperties)
           
 void setSslSocketConnectors(Map<Integer,org.eclipse.jetty.server.ssl.SslSelectChannelConnector> connectors)
           
 void setThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool)
           
 void setUseContinuation(boolean useContinuation)
           
protected  void startMbContainer()
          Starts mbContainer and registers the container with itself as a managed bean logging an error if there is a problem starting the container.
 
Methods inherited from class org.apache.camel.component.http.HttpComponent
configureAuth, configureProxyAuth, createHttpClientConfigurer, getHttpBinding, getHttpClientConfigurer, getHttpConfiguration, getHttpConnectionManager, setHttpBinding, setHttpClientConfigurer, setHttpConfiguration, setHttpConnectionManager, useIntrospectionOnEndpoint
 
Methods inherited from class org.apache.camel.impl.HeaderFilterStrategyComponent
getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategy
 
Methods inherited from class org.apache.camel.impl.DefaultComponent
afterConfiguration, createEndpoint, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, ifStartsWithReturnRemainder, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, setCamelContext, setProperties, validateParameters, validateURI
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TMP_DIR

public static final String TMP_DIR
See Also:
Constant Field Values

CONNECTORS

protected static final HashMap<String,org.apache.camel.component.jetty.JettyHttpComponent.ConnectorRef> CONNECTORS

sslKeyPassword

protected String sslKeyPassword

sslPassword

protected String sslPassword

sslKeystore

protected String sslKeystore

sslSocketConnectors

protected Map<Integer,org.eclipse.jetty.server.ssl.SslSelectChannelConnector> sslSocketConnectors

socketConnectors

protected Map<Integer,org.eclipse.jetty.server.nio.SelectChannelConnector> socketConnectors

sslSocketConnectorProperties

protected Map<String,Object> sslSocketConnectorProperties

socketConnectorProperties

protected Map<String,Object> socketConnectorProperties

httpClient

protected org.eclipse.jetty.client.HttpClient httpClient

httpClientThreadPool

protected org.eclipse.jetty.util.thread.ThreadPool httpClientThreadPool

httpClientMinThreads

protected Integer httpClientMinThreads

httpClientMaxThreads

protected Integer httpClientMaxThreads

minThreads

protected Integer minThreads

maxThreads

protected Integer maxThreads

threadPool

protected org.eclipse.jetty.util.thread.ThreadPool threadPool

mbContainer

protected org.eclipse.jetty.jmx.MBeanContainer mbContainer

enableJmx

protected boolean enableJmx

jettyHttpBinding

protected JettyHttpBinding jettyHttpBinding

continuationTimeout

protected Long continuationTimeout

useContinuation

protected boolean useContinuation
Constructor Detail

JettyHttpComponent

public JettyHttpComponent()
Method Detail

createEndpoint

protected Endpoint createEndpoint(String uri,
                                  String remaining,
                                  Map<String,Object> parameters)
                           throws Exception
Description copied from class: DefaultComponent
A factory method allowing derived components to create a new endpoint from the given URI, remaining path and optional parameters

Overrides:
createEndpoint in class HttpComponent
Parameters:
uri - the full URI of the endpoint
remaining - the remaining part of the URI without the query parameters or component prefix
parameters - the optional parameters passed in
Returns:
a newly created endpoint or null if the endpoint cannot be created based on the inputs
Throws:
Exception

connect

public void connect(HttpConsumer consumer)
             throws Exception
Connects the URL specified on the endpoint to the specified processor.

Overrides:
connect in class HttpComponent
Parameters:
consumer - the consumer
Throws:
Exception - can be thrown

disconnect

public void disconnect(HttpConsumer consumer)
                throws Exception
Disconnects the URL specified on the endpoint from the specified processor.

Overrides:
disconnect in class HttpComponent
Parameters:
consumer - the consumer
Throws:
Exception - can be thrown

getSslKeyPassword

public String getSslKeyPassword()

setSslKeyPassword

public void setSslKeyPassword(String sslKeyPassword)

getSslPassword

public String getSslPassword()

setSslPassword

public void setSslPassword(String sslPassword)

setKeystore

public void setKeystore(String sslKeystore)

getKeystore

public String getKeystore()

getSslSocketConnector

protected org.eclipse.jetty.server.ssl.SslSelectChannelConnector getSslSocketConnector(int port)
                                                                                throws Exception
Throws:
Exception

createSslSocketConnector

protected org.eclipse.jetty.server.ssl.SslSelectChannelConnector createSslSocketConnector()
                                                                                   throws Exception
Throws:
Exception

getSslSocketConnectors

public Map<Integer,org.eclipse.jetty.server.ssl.SslSelectChannelConnector> getSslSocketConnectors()

setSslSocketConnectors

public void setSslSocketConnectors(Map<Integer,org.eclipse.jetty.server.ssl.SslSelectChannelConnector> connectors)

getSocketConnector

public org.eclipse.jetty.server.nio.SelectChannelConnector getSocketConnector(int port)
                                                                       throws Exception
Throws:
Exception

createSocketConnector

protected org.eclipse.jetty.server.nio.SelectChannelConnector createSocketConnector()
                                                                             throws Exception
Throws:
Exception

setSocketConnectors

public void setSocketConnectors(Map<Integer,org.eclipse.jetty.server.nio.SelectChannelConnector> socketConnectors)

getHttpClient

public org.eclipse.jetty.client.HttpClient getHttpClient()

setHttpClient

public void setHttpClient(org.eclipse.jetty.client.HttpClient httpClient)

getHttpClientThreadPool

public org.eclipse.jetty.util.thread.ThreadPool getHttpClientThreadPool()

setHttpClientThreadPool

public void setHttpClientThreadPool(org.eclipse.jetty.util.thread.ThreadPool httpClientThreadPool)

getHttpClientMinThreads

public Integer getHttpClientMinThreads()

setHttpClientMinThreads

public void setHttpClientMinThreads(Integer httpClientMinThreads)

getHttpClientMaxThreads

public Integer getHttpClientMaxThreads()

setHttpClientMaxThreads

public void setHttpClientMaxThreads(Integer httpClientMaxThreads)

getMinThreads

public Integer getMinThreads()

setMinThreads

public void setMinThreads(Integer minThreads)

getMaxThreads

public Integer getMaxThreads()

setMaxThreads

public void setMaxThreads(Integer maxThreads)

getThreadPool

public org.eclipse.jetty.util.thread.ThreadPool getThreadPool()

setThreadPool

public void setThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool)

setEnableJmx

public void setEnableJmx(boolean enableJmx)

isEnableJmx

public boolean isEnableJmx()

getJettyHttpBinding

public JettyHttpBinding getJettyHttpBinding()

setJettyHttpBinding

public void setJettyHttpBinding(JettyHttpBinding jettyHttpBinding)

getMbContainer

public org.eclipse.jetty.jmx.MBeanContainer getMbContainer()

setMbContainer

public void setMbContainer(org.eclipse.jetty.jmx.MBeanContainer mbContainer)

getSslSocketConnectorProperties

public Map<String,Object> getSslSocketConnectorProperties()

setSslSocketConnectorProperties

public void setSslSocketConnectorProperties(Map<String,Object> sslSocketConnectorProperties)

getSocketConnectorProperties

public Map<String,Object> getSocketConnectorProperties()

setSocketConnectorProperties

public void setSocketConnectorProperties(Map<String,Object> socketConnectorProperties)

addSocketConnectorProperty

public void addSocketConnectorProperty(String key,
                                       Object value)

addSslSocketConnectorProperty

public void addSslSocketConnectorProperty(String key,
                                          Object value)

getContinuationTimeout

public Long getContinuationTimeout()

setContinuationTimeout

public void setContinuationTimeout(Long continuationTimeout)

isUseContinuation

public boolean isUseContinuation()

setUseContinuation

public void setUseContinuation(boolean useContinuation)

createServletForConnector

protected CamelServlet createServletForConnector(org.eclipse.jetty.server.Server server,
                                                 org.eclipse.jetty.server.Connector connector,
                                                 List<org.eclipse.jetty.server.Handler> handlers,
                                                 JettyHttpEndpoint endpoint)
                                          throws Exception
Throws:
Exception

createServer

protected org.eclipse.jetty.server.Server createServer()
                                                throws Exception
Throws:
Exception

startMbContainer

protected void startMbContainer()
Starts mbContainer and registers the container with itself as a managed bean logging an error if there is a problem starting the container. Does nothing if mbContainer is null.


doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class DefaultComponent
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class DefaultComponent
Throws:
Exception


Apache CAMEL