org.apache.servicemix.camel.osgi
Class OsgiCamelJbiComponent
java.lang.Object
org.apache.servicemix.common.AsyncBaseLifeCycle
org.apache.servicemix.common.DefaultComponent
org.apache.servicemix.camel.CamelJbiComponent
org.apache.servicemix.camel.osgi.OsgiCamelJbiComponent
- All Implemented Interfaces:
- javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle, CamelComponent, ServiceMixComponent
public class OsgiCamelJbiComponent
- extends CamelJbiComponent
When deploying a JBI packaged SU to camel component, camel-spring and camel-osgi
can not be found by Spring/XBean, thus leading to an exception about the spring
and osgi namespaces not being found. We need to hack the classloader for SUs to
force a reference to camel-spring, camel-osgi and camel-cxf in the SU classloader parents.
We also need to inject the bundleContext into the CamelContextFactoryBean to
make sure the CamelContextFactoryBean will replace the regular ResolverUtils
with OSGi ResolverUtils
| 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 |
| Methods inherited from class org.apache.servicemix.camel.CamelJbiComponent |
activateJbiEndpoint, addJbiComponent, createEndpoint, deactivateJbiEndpoint, getConfiguredEndpoints, getEndpointClasses, getEPRProtocols, getJbiComponent, getResolvedEPR, isEndpointExposedOnNmr, removeJbiComponent |
| 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, isKnownEndpoint, removeEndpoint, resolveEndpointReference, validateEndpoint |
| Methods inherited from class org.apache.servicemix.common.AsyncBaseLifeCycle |
createExecutorFactory, createExtensionMBeanName, exceptionShouldRollbackTx, findExecutorFactory, getContainer, getContext, getCurrentState, getExecutor, getExecutorFactory, getExtensionMBean, 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 javax.jbi.component.Component |
getLifeCycle, getServiceDescription, getServiceUnitManager, isExchangeWithConsumerOkay, isExchangeWithProviderOkay, resolveEndpointReference |
OsgiCamelJbiComponent
public OsgiCamelJbiComponent()
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
getBundleContext
public org.osgi.framework.BundleContext getBundleContext()
createServiceUnitManager
public BaseServiceUnitManager createServiceUnitManager()
- Overrides:
createServiceUnitManager in class CamelJbiComponent
prepareShutdown
public void prepareShutdown(Endpoint endpoint)
throws java.lang.InterruptedException
- Specified by:
prepareShutdown in interface ServiceMixComponent- Overrides:
prepareShutdown in class AsyncBaseLifeCycle
- Throws:
java.lang.InterruptedException
getShutdownTimeout
public long getShutdownTimeout()
setShutdownTimeout
public void setShutdownTimeout(long shutdownTimeout)
Copyright © 2005-2011 FuseSource. All Rights Reserved.