public class DefaultComponent extends AsyncBaseLifeCycle implements ServiceMixComponent
A useful base class for writing new JBI components which includes the ComponentLifeCycle interface methods so that
you can write a new component in a single class with minimal overloading.
| Modifier and Type | Field and Description |
|---|---|
protected javax.jbi.component.ComponentLifeCycle |
lifeCycle |
protected org.slf4j.Logger |
logger |
protected Registry |
registry |
protected ServiceUnit |
serviceUnit |
protected BaseServiceUnitManager |
serviceUnitManager |
channel, component, consumerExecutor, container, context, correlationId, currentState, executorFactory, INITIALIZED, knownExchanges, mbeanName, poller, polling, providerExecutor, running, transactionManager, workManagerCreated| Constructor and Description |
|---|
DefaultComponent() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEndpoint(Endpoint endpoint)
Dynamically adds a new endpoint
|
protected static java.util.List |
asList(java.lang.Object[] endpoints)
A little helper method to turn a possibly null list of endpoints into a list of endpoints
|
protected Registry |
createRegistry() |
protected BaseServiceUnitManager |
createServiceUnitManager()
Create the service unit manager.
|
protected void |
doInit() |
protected void |
doShutDown() |
protected void |
doStart() |
protected void |
doStop() |
javax.jbi.component.ComponentContext |
getComponentContext() |
java.lang.String |
getComponentName() |
protected java.util.List |
getConfiguredEndpoints()
Returns an array of configured endpoints for the component or null if there are no configured endpoints
|
protected java.lang.Class[] |
getEndpointClasses()
Returns a list of valid endpoint classes or null if the component does not wish to programmatically
restrict the list of possible endpoint classes
|
javax.xml.namespace.QName |
getEPRElementName() |
protected java.lang.String[] |
getEPRProtocols() |
javax.xml.namespace.QName |
getEPRServiceName() |
javax.jbi.component.ComponentLifeCycle |
getLifeCycle() |
org.slf4j.Logger |
getLogger() |
Registry |
getRegistry() |
org.w3c.dom.Document |
getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint endpoint) |
ServiceUnit |
getServiceUnit()
Returns the service unit, lazily creating one on demand
|
javax.jbi.component.ServiceUnitManager |
getServiceUnitManager() |
boolean |
isExchangeWithConsumerOkay(javax.jbi.servicedesc.ServiceEndpoint endpoint,
javax.jbi.messaging.MessageExchange exchange) |
boolean |
isExchangeWithProviderOkay(javax.jbi.servicedesc.ServiceEndpoint endpoint,
javax.jbi.messaging.MessageExchange exchange) |
boolean |
isKnownEndpoint(Endpoint endpoint) |
void |
removeEndpoint(Endpoint endpoint) |
javax.jbi.servicedesc.ServiceEndpoint |
resolveEndpointReference(org.w3c.dom.DocumentFragment epr) |
protected void |
validateEndpoint(Endpoint endpoint)
Provides a hook to validate the statically configured endpoint
|
createExecutorFactory, createExtensionMBeanName, exceptionShouldRollbackTx, findExecutorFactory, getContainer, getContext, getCurrentState, getExecutor, getExecutorFactory, getExtensionMBean, getExtensionMBeanName, getKnownExchanges, getResolvedEPR, getSmx3Container, handleExchange, init, isInitialized, isShutDown, isStarted, isStopped, isUnknown, onMessageExchange, pollDeliveryChannel, prepareExchange, prepareShutdown, prepareShutdown, processExchange, processExchangeInTx, processExchangeWithoutTx, setComponent, setCurrentState, setExecutor, setExecutorFactory, shutDown, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContainer, getExecutor, getSmx3Container, handleExchange, prepareExchange, prepareShutdownprotected final transient org.slf4j.Logger logger
protected Registry registry
protected BaseServiceUnitManager serviceUnitManager
protected ServiceUnit serviceUnit
protected javax.jbi.component.ComponentLifeCycle lifeCycle
public javax.jbi.component.ComponentLifeCycle getLifeCycle()
getLifeCycle in interface javax.jbi.component.Componentpublic javax.jbi.component.ServiceUnitManager getServiceUnitManager()
getServiceUnitManager in interface javax.jbi.component.Componentpublic org.w3c.dom.Document getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint endpoint)
getServiceDescription in interface javax.jbi.component.Componentpublic boolean isExchangeWithConsumerOkay(javax.jbi.servicedesc.ServiceEndpoint endpoint,
javax.jbi.messaging.MessageExchange exchange)
isExchangeWithConsumerOkay in interface javax.jbi.component.Componentpublic boolean isExchangeWithProviderOkay(javax.jbi.servicedesc.ServiceEndpoint endpoint,
javax.jbi.messaging.MessageExchange exchange)
isExchangeWithProviderOkay in interface javax.jbi.component.Componentpublic javax.xml.namespace.QName getEPRServiceName()
getEPRServiceName in class AsyncBaseLifeCyclepublic javax.xml.namespace.QName getEPRElementName()
getEPRElementName in interface ServiceMixComponentprotected java.lang.String[] getEPRProtocols()
public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(org.w3c.dom.DocumentFragment epr)
resolveEndpointReference in interface javax.jbi.component.Componentprotected BaseServiceUnitManager createServiceUnitManager()
protected Registry createRegistry()
public javax.jbi.component.ComponentContext getComponentContext()
getComponentContext in interface ServiceMixComponentpublic java.lang.String getComponentName()
getComponentName in interface ServiceMixComponentpublic org.slf4j.Logger getLogger()
getLogger in interface ServiceMixComponentpublic Registry getRegistry()
getRegistry in interface ServiceMixComponentpublic ServiceUnit getServiceUnit()
protected java.util.List getConfiguredEndpoints()
protected java.lang.Class[] getEndpointClasses()
protected static java.util.List asList(java.lang.Object[] endpoints)
public void addEndpoint(Endpoint endpoint) throws java.lang.Exception
java.lang.Exceptionpublic void removeEndpoint(Endpoint endpoint) throws java.lang.Exception
java.lang.Exceptionpublic boolean isKnownEndpoint(Endpoint endpoint)
protected void validateEndpoint(Endpoint endpoint) throws javax.jbi.management.DeploymentException
javax.jbi.management.DeploymentExceptionprotected void doInit()
throws java.lang.Exception
doInit in class AsyncBaseLifeCyclejava.lang.Exceptionprotected void doStart()
throws java.lang.Exception
doStart in class AsyncBaseLifeCyclejava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
doStop in class AsyncBaseLifeCyclejava.lang.Exceptionprotected void doShutDown()
throws java.lang.Exception
doShutDown in class AsyncBaseLifeCyclejava.lang.ExceptionCopyright © 2005-2014 FuseSource. All Rights Reserved.