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, ServiceMixComponent

public class HttpComponent
extends 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 java.lang.String[] EPR_PROTOCOLS
           
protected  java.lang.String host
           
protected  java.lang.String path
           
protected  int port
           
protected  java.lang.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, consumerExecutor, container, context, correlationId, currentState, executorFactory, INITIALIZED, knownExchanges, mbeanName, poller, polling, providerExecutor, running, transactionManager, workManagerCreated
 
Constructor Summary
HttpComponent()
           
 
Method Summary
 org.mortbay.jetty.client.HttpClient createNewJettyClient()
           
 BaseServiceUnitManager createServiceUnitManager()
           
protected  void doInit()
           
protected  void doShutDown()
           
protected  void doStart()
           
protected  void doStop()
           
 java.lang.Object getAuthenticationService()
           
 org.apache.commons.httpclient.HttpClient getClient()
           
 HttpConfiguration getConfiguration()
           
protected  java.util.List getConfiguredEndpoints()
           
 org.mortbay.jetty.client.HttpClient getConnectionPool()
           
protected  java.lang.Class[] getEndpointClasses()
           
 HttpEndpointType[] getEndpoints()
           
protected  java.lang.String[] getEPRProtocols()
           
protected  java.lang.Object getExtensionMBean()
           
 java.lang.String getHost()
          Returns the host name.
 java.lang.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
 java.lang.String getPath()
           
 int getPort()
           
 java.lang.String getProtocol()
           
protected  Endpoint getResolvedEPR(javax.jbi.servicedesc.ServiceEndpoint ep)
           
 ContextManager getServer()
           
 void setAuthenticationService(java.lang.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(java.lang.String host)
          Sets the host name.
 void setKeystoreManager(java.lang.Object keystoreManager)
           
 void setPath(java.lang.String path)
           
 void setPort(int port)
           
 void setProtocol(java.lang.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, 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 java.lang.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 java.lang.String protocol

host

protected java.lang.String host

port

protected int port

path

protected java.lang.String path
Constructor Detail

HttpComponent

public HttpComponent()
Method Detail

getHost

public java.lang.String getHost()
Returns the host name.

Returns:
a string containing the host name

setHost

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

Parameters:
host - a string specifying the host name

getPath

public java.lang.String getPath()
Returns:
the path

setPath

public void setPath(java.lang.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 java.lang.String getProtocol()
Returns:
the protocol

setProtocol

public void setProtocol(java.lang.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 java.lang.Exception
Throws:
java.lang.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 java.lang.Object getExtensionMBean()
                                      throws java.lang.Exception
Overrides:
getExtensionMBean in class AsyncBaseLifeCycle
Throws:
java.lang.Exception

doInit

protected void doInit()
               throws java.lang.Exception
Overrides:
doInit in class DefaultComponent
Throws:
java.lang.Exception

doShutDown

protected void doShutDown()
                   throws java.lang.Exception
Overrides:
doShutDown in class DefaultComponent
Throws:
java.lang.Exception

doStart

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

doStop

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

getEPRProtocols

protected java.lang.String[] getEPRProtocols()
Overrides:
getEPRProtocols in class DefaultComponent

getResolvedEPR

protected Endpoint getResolvedEPR(javax.jbi.servicedesc.ServiceEndpoint ep)
                           throws java.lang.Exception
Overrides:
getResolvedEPR in class AsyncBaseLifeCycle
Throws:
java.lang.Exception

getKeystoreManager

public java.lang.Object getKeystoreManager()
Returns:
the keystoreManager

setKeystoreManager

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

getAuthenticationService

public java.lang.Object getAuthenticationService()
Returns:
the authenticationService

setAuthenticationService

public void setAuthenticationService(java.lang.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 BaseServiceUnitManager createServiceUnitManager()
Overrides:
createServiceUnitManager in class DefaultComponent

getConfiguredEndpoints

protected java.util.List getConfiguredEndpoints()
Overrides:
getConfiguredEndpoints in class DefaultComponent

getEndpointClasses

protected java.lang.Class[] getEndpointClasses()
Overrides:
getEndpointClasses in class DefaultComponent


Copyright © 2005-2012 FuseSource. All Rights Reserved.