org.apache.servicemix.http
Class HttpComponent

java.lang.Object
  extended by org.apache.servicemix.common.AsyncBaseLifeCycle
      extended by org.apache.servicemix.common.DefaultComponent
          extended by org.apache.servicemix.http.HttpComponent
All Implemented Interfaces:
javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle, org.apache.servicemix.common.ServiceMixComponent

public class HttpComponent
extends org.apache.servicemix.common.DefaultComponent

an HTTP JBI component

Author:
gnodet

Field Summary
protected  org.apache.commons.httpclient.HttpClient client
           
protected  HttpConfiguration configuration
           
protected  org.apache.commons.httpclient.MultiThreadedHttpConnectionManager connectionManager
           
protected  org.mortbay.jetty.client.HttpClient connectionPool
           
protected  HttpEndpointType[] endpoints
           
static String[] EPR_PROTOCOLS
           
protected  String host
           
protected  String path
           
protected  int port
           
protected  String protocol
           
protected  ContextManager server
           
 
Fields inherited from class org.apache.servicemix.common.DefaultComponent
lifeCycle, logger, registry, serviceUnit, serviceUnitManager
 
Fields inherited from class org.apache.servicemix.common.AsyncBaseLifeCycle
channel, component, container, context, correlationId, currentState, executor, executorFactory, INITIALIZED, knownExchanges, mbeanName, poller, polling, running, transactionManager, workManagerCreated
 
Constructor Summary
HttpComponent()
           
 
Method Summary
 org.mortbay.jetty.client.HttpClient createNewJettyClient()
           
 org.apache.servicemix.common.BaseServiceUnitManager createServiceUnitManager()
           
protected  void doInit()
           
protected  void doShutDown()
           
protected  void doStart()
           
protected  void doStop()
           
 Object getAuthenticationService()
           
 org.apache.commons.httpclient.HttpClient getClient()
           
 HttpConfiguration getConfiguration()
           
protected  List getConfiguredEndpoints()
           
 org.mortbay.jetty.client.HttpClient getConnectionPool()
           
protected  Class[] getEndpointClasses()
           
 HttpEndpointType[] getEndpoints()
           
protected  String[] getEPRProtocols()
           
protected  Object getExtensionMBean()
           
 String getHost()
          Returns the host name.
 Object getKeystoreManager()
           
 HttpProcessor getMainProcessor()
          When servicemix-http is embedded inside a web application and configured to reuse the existing servlet container, this method will create and return the HTTPProcessor which will handle all servlet calls
 String getPath()
           
 int getPort()
           
 String getProtocol()
           
protected  org.apache.servicemix.common.Endpoint getResolvedEPR(javax.jbi.servicedesc.ServiceEndpoint ep)
           
 ContextManager getServer()
           
 void setAuthenticationService(Object authenticationService)
           
 void setClient(org.apache.commons.httpclient.HttpClient client)
           
 void setConfiguration(HttpConfiguration configuration)
           
 void setConnectionPool(org.mortbay.jetty.client.HttpClient connectionPool)
          Sets the connection pool used by the component.
 void setEndpoints(HttpEndpointType[] endpoints)
           
 void setHost(String host)
          Sets the host name.
 void setKeystoreManager(Object keystoreManager)
           
 void setPath(String path)
           
 void setPort(int port)
           
 void setProtocol(String protocol)
           
 void setServer(ContextManager server)
           
 
Methods inherited from class org.apache.servicemix.common.DefaultComponent
addEndpoint, asList, createRegistry, getComponentContext, getComponentName, getEPRElementName, getEPRServiceName, getLifeCycle, getLogger, getRegistry, getServiceDescription, getServiceUnit, getServiceUnitManager, isExchangeWithConsumerOkay, isExchangeWithProviderOkay, isKnownEndpoint, removeEndpoint, resolveEndpointReference, validateEndpoint
 
Methods inherited from class org.apache.servicemix.common.AsyncBaseLifeCycle
createExecutorFactory, createExtensionMBeanName, exceptionShouldRollbackTx, findExecutorFactory, getContainer, getContext, getCurrentState, getExecutor, getExecutorFactory, getExtensionMBeanName, getKnownExchanges, getSmx3Container, handleExchange, init, isInitialized, isShutDown, isStarted, isStopped, isUnknown, onMessageExchange, pollDeliveryChannel, prepareExchange, prepareShutdown, processExchange, processExchangeInTx, setComponent, setCurrentState, setExecutor, setExecutorFactory, shutDown, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.servicemix.common.ServiceMixComponent
getContainer, getExecutor, getSmx3Container, handleExchange, prepareExchange, prepareShutdown
 

Field Detail

EPR_PROTOCOLS

public static final String[] EPR_PROTOCOLS

server

protected ContextManager server

client

protected org.apache.commons.httpclient.HttpClient client

connectionManager

protected org.apache.commons.httpclient.MultiThreadedHttpConnectionManager connectionManager

connectionPool

protected org.mortbay.jetty.client.HttpClient connectionPool

configuration

protected HttpConfiguration configuration

endpoints

protected HttpEndpointType[] endpoints

protocol

protected String protocol

host

protected String host

port

protected int port

path

protected String path
Constructor Detail

HttpComponent

public HttpComponent()
Method Detail

getHost

public String getHost()
Returns the host name.

Returns:
a string contianing the host name

setHost

public void setHost(String host)
Sets the host name.

Parameters:
host - a string specifying the host name

getPath

public String getPath()
Returns:
the path

setPath

public void setPath(String path)
Parameters:
path - the path to set

getPort

public int getPort()
Returns:
the port

setPort

public void setPort(int port)
Parameters:
port - the port to set

getProtocol

public String getProtocol()
Returns:
the protocol

setProtocol

public void setProtocol(String protocol)
Parameters:
protocol - the protocol to set

getEndpoints

public HttpEndpointType[] getEndpoints()
Returns:
the endpoints

setEndpoints

public void setEndpoints(HttpEndpointType[] endpoints)
Parameters:
endpoints - the endpoints to set

getServer

public ContextManager getServer()

setServer

public void setServer(ContextManager server)

getClient

public org.apache.commons.httpclient.HttpClient getClient()

setClient

public void setClient(org.apache.commons.httpclient.HttpClient client)
Parameters:
client - the HTTP client instance used by the component

getConnectionPool

public org.mortbay.jetty.client.HttpClient getConnectionPool()

createNewJettyClient

public org.mortbay.jetty.client.HttpClient createNewJettyClient()
                                                         throws Exception
Throws:
Exception

setConnectionPool

public void setConnectionPool(org.mortbay.jetty.client.HttpClient connectionPool)
Sets the connection pool used by the component. The connection pool is a Jetty HTTP client instance with a thread pool set using the HTTP component's jettyClientThreadPoolSize property.

Parameters:
connectionPool - a Jetty HttpClient

getConfiguration

public HttpConfiguration getConfiguration()
Returns:
Returns the configuration.

setConfiguration

public void setConfiguration(HttpConfiguration configuration)
Parameters:
configuration - an HttpConfiguration object containing the configuration information needed to establish HTTP connections

getExtensionMBean

protected Object getExtensionMBean()
                            throws Exception
Overrides:
getExtensionMBean in class org.apache.servicemix.common.AsyncBaseLifeCycle
Throws:
Exception

doInit

protected void doInit()
               throws Exception
Overrides:
doInit in class org.apache.servicemix.common.DefaultComponent
Throws:
Exception

doShutDown

protected void doShutDown()
                   throws Exception
Overrides:
doShutDown in class org.apache.servicemix.common.DefaultComponent
Throws:
Exception

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class org.apache.servicemix.common.DefaultComponent
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class org.apache.servicemix.common.DefaultComponent
Throws:
Exception

getEPRProtocols

protected String[] getEPRProtocols()
Overrides:
getEPRProtocols in class org.apache.servicemix.common.DefaultComponent

getResolvedEPR

protected org.apache.servicemix.common.Endpoint getResolvedEPR(javax.jbi.servicedesc.ServiceEndpoint ep)
                                                        throws Exception
Overrides:
getResolvedEPR in class org.apache.servicemix.common.AsyncBaseLifeCycle
Throws:
Exception

getKeystoreManager

public Object getKeystoreManager()
Returns:
the keystoreManager

setKeystoreManager

public void setKeystoreManager(Object keystoreManager)
Parameters:
keystoreManager - the keystoreManager to set

getAuthenticationService

public Object getAuthenticationService()
Returns:
the authenticationService

setAuthenticationService

public void setAuthenticationService(Object authenticationService)
Parameters:
authenticationService - the authenticationService to set

getMainProcessor

public HttpProcessor getMainProcessor()
When servicemix-http is embedded inside a web application and configured to reuse the existing servlet container, this method will create and return the HTTPProcessor which will handle all servlet calls


createServiceUnitManager

public org.apache.servicemix.common.BaseServiceUnitManager createServiceUnitManager()
Overrides:
createServiceUnitManager in class org.apache.servicemix.common.DefaultComponent

getConfiguredEndpoints

protected List getConfiguredEndpoints()
Overrides:
getConfiguredEndpoints in class org.apache.servicemix.common.DefaultComponent

getEndpointClasses

protected Class[] getEndpointClasses()
Overrides:
getEndpointClasses in class org.apache.servicemix.common.DefaultComponent


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.