org.apache.camel.component.jbi
Class CamelJbiComponent

java.lang.Object
  extended by org.apache.servicemix.common.AsyncBaseLifeCycle
      extended by org.apache.servicemix.common.BaseLifeCycle
          extended by org.apache.servicemix.common.DefaultComponent
              extended by org.apache.camel.component.jbi.CamelJbiComponent
All Implemented Interfaces:
javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle, org.apache.servicemix.common.ServiceMixComponent, org.apache.servicemix.MessageExchangeListener

public class CamelJbiComponent
extends org.apache.servicemix.common.DefaultComponent
implements org.apache.camel.Component<org.apache.camel.Exchange>

Deploys the camel endpoints within JBI

Version:
$Revision: 426415 $

Field Summary
protected  CamelSpringDeployer deployer
           
 
Fields inherited from class org.apache.servicemix.common.DefaultComponent
logger, registry, serviceUnit, serviceUnitManager
 
Fields inherited from class org.apache.servicemix.common.AsyncBaseLifeCycle
channel, component, context, correlationId, currentState, executor, executorFactory, INITIALIZED, mbeanName, poller, polling, processors, running, transactionManager, workManagerCreated
 
Constructor Summary
CamelJbiComponent()
           
 
Method Summary
 CamelJbiEndpoint activateJbiEndpoint(org.apache.camel.Endpoint camelEndpoint, org.apache.camel.Processor processor)
          Activating a JBI endpoint created by a camel consumer.
protected  org.apache.camel.Processor createCamelProcessor(org.apache.camel.Endpoint camelEndpoint)
           
 CamelJbiEndpoint createEndpoint(javax.jbi.servicedesc.ServiceEndpoint ep)
           
 org.apache.camel.Endpoint<org.apache.camel.Exchange> createEndpoint(String uri)
           
protected  String createEndpointName()
           
 CamelJbiEndpoint createJbiEndpointFromCamel(org.apache.camel.Endpoint camelEndpoint)
          Returns a JBI endpoint created for the given Camel endpoint
protected  CamelJbiEndpoint createJbiEndpointFromCamel(org.apache.camel.Endpoint camelEndpoint, org.apache.camel.Processor processor)
           
 org.apache.servicemix.common.BaseServiceUnitManager createServiceUnitManager()
           
 void deactivateJbiEndpoint(CamelJbiEndpoint jbiEndpoint)
           
 JbiBinding getBinding()
           
 org.apache.camel.CamelContext getCamelContext()
           
protected  List<CamelJbiEndpoint> getConfiguredEndpoints()
           
protected  Class[] getEndpointClasses()
           
protected  String[] getEPRProtocols()
           
 ScheduledExecutorService getExecutorService()
           
protected  org.apache.servicemix.common.Endpoint getResolvedEPR(javax.jbi.servicedesc.ServiceEndpoint ep)
           
 boolean isEndpointExposedOnNmr(org.apache.camel.Endpoint endpoint)
          Should we expose the Camel JBI onto the NMR.
 void setBinding(JbiBinding binding)
           
 void setCamelContext(org.apache.camel.CamelContext camelContext)
           
 
Methods inherited from class org.apache.servicemix.common.DefaultComponent
addEndpoint, asList, createRegistry, doInit, doShutDown, doStart, doStop, getComponentContext, getComponentName, getEPRElementName, getEPRServiceName, getLifeCycle, getLogger, getRegistry, getServiceDescription, getServiceUnit, getServiceUnitManager, isExchangeWithConsumerOkay, isExchangeWithProviderOkay, resolveEndpointReference, validateEndpoint
 
Methods inherited from class org.apache.servicemix.common.BaseLifeCycle
onMessageExchange
 
Methods inherited from class org.apache.servicemix.common.AsyncBaseLifeCycle
createExecutorFactory, createExtensionMBeanName, exceptionShouldRollbackTx, findExecutorFactory, getContext, getCurrentState, getExecutor, getExtensionMBean, getExtensionMBeanName, init, isInitialized, isShutDown, isStarted, isStopped, isUnknown, pollDeliveryChannel, prepareConsumerExchange, processExchange, processExchangeInTx, sendConsumerExchange, sendConsumerExchange, setComponent, setCurrentState, 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
getExecutor, prepareConsumerExchange, sendConsumerExchange
 

Field Detail

deployer

protected CamelSpringDeployer deployer
Constructor Detail

CamelJbiComponent

public CamelJbiComponent()
Method Detail

createServiceUnitManager

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

getConfiguredEndpoints

protected List<CamelJbiEndpoint> getConfiguredEndpoints()
Specified by:
getConfiguredEndpoints in class org.apache.servicemix.common.DefaultComponent
Returns:
List of endpoints
See Also:
DefaultComponent.getConfiguredEndpoints()

getEndpointClasses

protected Class[] getEndpointClasses()
Specified by:
getEndpointClasses in class org.apache.servicemix.common.DefaultComponent
Returns:
Class[]
See Also:
DefaultComponent.getEndpointClasses()

getBinding

public JbiBinding getBinding()
Returns:
the binding

setBinding

public void setBinding(JbiBinding binding)
Parameters:
binding - the binding to set

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

createEndpoint

public CamelJbiEndpoint createEndpoint(javax.jbi.servicedesc.ServiceEndpoint ep)
                                throws URISyntaxException
Throws:
URISyntaxException

createEndpoint

public org.apache.camel.Endpoint<org.apache.camel.Exchange> createEndpoint(String uri)

getCamelContext

public org.apache.camel.CamelContext getCamelContext()

setCamelContext

public void setCamelContext(org.apache.camel.CamelContext camelContext)

getExecutorService

public ScheduledExecutorService getExecutorService()

activateJbiEndpoint

public CamelJbiEndpoint activateJbiEndpoint(org.apache.camel.Endpoint camelEndpoint,
                                            org.apache.camel.Processor processor)
                                     throws Exception
Activating a JBI endpoint created by a camel consumer.

Throws:
Exception

deactivateJbiEndpoint

public void deactivateJbiEndpoint(CamelJbiEndpoint jbiEndpoint)
                           throws Exception
Throws:
Exception

createJbiEndpointFromCamel

protected CamelJbiEndpoint createJbiEndpointFromCamel(org.apache.camel.Endpoint camelEndpoint,
                                                      org.apache.camel.Processor processor)

createEndpointName

protected String createEndpointName()

createJbiEndpointFromCamel

public CamelJbiEndpoint createJbiEndpointFromCamel(org.apache.camel.Endpoint camelEndpoint)
Returns a JBI endpoint created for the given Camel endpoint


createCamelProcessor

protected org.apache.camel.Processor createCamelProcessor(org.apache.camel.Endpoint camelEndpoint)

isEndpointExposedOnNmr

public boolean isEndpointExposedOnNmr(org.apache.camel.Endpoint endpoint)
Should we expose the Camel JBI onto the NMR.

We may wish to add some policy stuff etc.

Parameters:
endpoint - the camel endpoint
Returns:
true if the endpoint should be exposed in the NMR


Copyright © 2007 Apache Software Foundation. All Rights Reserved.