org.apache.camel.component.http4
Class HttpComponent

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.http4.HttpComponent
All Implemented Interfaces:
CamelContextAware, Component, Service, ShutdownableService, HeaderFilterStrategyAware

public class HttpComponent
extends HeaderFilterStrategyComponent

Defines the HTTP Component

Version:
$Revision: 20451 $

Field Summary
protected  org.apache.http.conn.ClientConnectionManager clientConnectionManager
           
protected  int connectionsPerRoute
           
protected  HttpBinding httpBinding
           
protected  HttpClientConfigurer httpClientConfigurer
           
protected  int maxTotalConnections
           
 
Constructor Summary
HttpComponent()
           
 
Method Summary
protected  org.apache.http.params.HttpParams configureHttpParams(Map<String,Object> parameters)
           
 void connect(HttpConsumer consumer)
          Connects the URL specified on the endpoint to the specified processor.
protected  org.apache.http.conn.ClientConnectionManager createConnectionManager()
           
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  HttpClientConfigurer createHttpClientConfigurer(Map<String,Object> parameters)
          Creates the HttpClientConfigurer based on the given parameters
 void disconnect(HttpConsumer consumer)
          Disconnects the URL specified on the endpoint from the specified processor.
 org.apache.http.conn.ClientConnectionManager getClientConnectionManager()
           
 int getConnectionsPerRoute()
           
 HttpBinding getHttpBinding()
           
 HttpClientConfigurer getHttpClientConfigurer()
           
 int getMaxTotalConnections()
           
protected  void registerPort(boolean secure, int port)
           
 void setClientConnectionManager(org.apache.http.conn.ClientConnectionManager clientConnectionManager)
           
 void setConnectionsPerRoute(int connectionsPerRoute)
           
 void setHttpBinding(HttpBinding httpBinding)
           
 void setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer)
           
 void setMaxTotalConnections(int maxTotalConnections)
           
 void start()
          Starts the service
 void stop()
          Stops the service
protected  boolean useIntrospectionOnEndpoint()
          Derived classes may wish to overload this to prevent the default introspection of URI parameters on the created Endpoint instance
 
Methods inherited from class org.apache.camel.impl.HeaderFilterStrategyComponent
getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategy
 
Methods inherited from class org.apache.camel.impl.DefaultComponent
afterConfiguration, createEndpoint, doStart, doStop, 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, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httpClientConfigurer

protected HttpClientConfigurer httpClientConfigurer

clientConnectionManager

protected org.apache.http.conn.ClientConnectionManager clientConnectionManager

httpBinding

protected HttpBinding httpBinding

maxTotalConnections

protected int maxTotalConnections

connectionsPerRoute

protected int connectionsPerRoute
Constructor Detail

HttpComponent

public HttpComponent()
Method Detail

connect

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

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.

Parameters:
consumer - the consumer
Throws:
Exception - can be thrown

createHttpClientConfigurer

protected HttpClientConfigurer createHttpClientConfigurer(Map<String,Object> parameters)
Creates the HttpClientConfigurer based on the given parameters

Parameters:
parameters - the map of parameters
Returns:
the configurer

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

Specified by:
createEndpoint in class DefaultComponent
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

registerPort

protected void registerPort(boolean secure,
                            int port)

createConnectionManager

protected org.apache.http.conn.ClientConnectionManager createConnectionManager()

configureHttpParams

protected org.apache.http.params.HttpParams configureHttpParams(Map<String,Object> parameters)
                                                         throws Exception
Throws:
Exception

useIntrospectionOnEndpoint

protected boolean useIntrospectionOnEndpoint()
Description copied from class: DefaultComponent
Derived classes may wish to overload this to prevent the default introspection of URI parameters on the created Endpoint instance

Overrides:
useIntrospectionOnEndpoint in class DefaultComponent

getHttpClientConfigurer

public HttpClientConfigurer getHttpClientConfigurer()

setHttpClientConfigurer

public void setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer)

getClientConnectionManager

public org.apache.http.conn.ClientConnectionManager getClientConnectionManager()

setClientConnectionManager

public void setClientConnectionManager(org.apache.http.conn.ClientConnectionManager clientConnectionManager)

getHttpBinding

public HttpBinding getHttpBinding()

setHttpBinding

public void setHttpBinding(HttpBinding httpBinding)

getMaxTotalConnections

public int getMaxTotalConnections()

setMaxTotalConnections

public void setMaxTotalConnections(int maxTotalConnections)

getConnectionsPerRoute

public int getConnectionsPerRoute()

setConnectionsPerRoute

public void setConnectionsPerRoute(int connectionsPerRoute)

start

public void start()
           throws Exception
Description copied from interface: Service
Starts the service

Specified by:
start in interface Service
Overrides:
start in class ServiceSupport
Throws:
Exception - is thrown if starting failed

stop

public void stop()
          throws Exception
Description copied from interface: Service
Stops the service

Specified by:
stop in interface Service
Overrides:
stop in class ServiceSupport
Throws:
Exception - is thrown if stopping failed


Apache CAMEL