|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.servicemix.common.AsyncBaseLifeCycle
org.apache.servicemix.common.BaseLifeCycle
org.apache.servicemix.common.DefaultComponent
public abstract class DefaultComponent
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.
| Field Summary | |
|---|---|
protected Log |
logger
|
protected Registry |
registry
|
protected ServiceUnit |
serviceUnit
|
protected BaseServiceUnitManager |
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 | |
|---|---|
DefaultComponent()
|
|
| Method Summary | |
|---|---|
void |
addEndpoint(Endpoint endpoint)
Dynamically adds a new endpoint |
protected static List |
asList(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()
|
String |
getComponentName()
|
protected abstract List |
getConfiguredEndpoints()
Returns an array of configured endpoints for the component or null if there are no configured endpoints |
protected abstract 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 |
QName |
getEPRElementName()
|
protected String[] |
getEPRProtocols()
|
QName |
getEPRServiceName()
|
javax.jbi.component.ComponentLifeCycle |
getLifeCycle()
|
Log |
getLogger()
|
Registry |
getRegistry()
|
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)
|
void |
removeEndpoint(Endpoint endpoint)
|
javax.jbi.servicedesc.ServiceEndpoint |
resolveEndpointReference(DocumentFragment epr)
|
protected void |
validateEndpoint(Endpoint endpoint)
Provides a hook to validate the statically configured endpoint |
| 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, getResolvedEPR, 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 |
|---|
protected final transient Log logger
protected Registry registry
protected BaseServiceUnitManager serviceUnitManager
protected ServiceUnit serviceUnit
| Constructor Detail |
|---|
public DefaultComponent()
| Method Detail |
|---|
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 Document getServiceDescription(javax.jbi.servicedesc.ServiceEndpoint endpoint)
getServiceDescription in interface javax.jbi.component.Component
public boolean isExchangeWithConsumerOkay(javax.jbi.servicedesc.ServiceEndpoint endpoint,
javax.jbi.messaging.MessageExchange exchange)
isExchangeWithConsumerOkay in interface javax.jbi.component.Component
public boolean isExchangeWithProviderOkay(javax.jbi.servicedesc.ServiceEndpoint endpoint,
javax.jbi.messaging.MessageExchange exchange)
isExchangeWithProviderOkay in interface javax.jbi.component.Componentpublic QName getEPRServiceName()
getEPRServiceName in class AsyncBaseLifeCyclepublic QName getEPRElementName()
getEPRElementName in interface ServiceMixComponentprotected String[] getEPRProtocols()
public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(DocumentFragment epr)
resolveEndpointReference in interface javax.jbi.component.Componentprotected BaseServiceUnitManager createServiceUnitManager()
protected Registry createRegistry()
public javax.jbi.component.ComponentContext getComponentContext()
getComponentContext in interface ServiceMixComponentpublic String getComponentName()
getComponentName in interface ServiceMixComponentpublic Log getLogger()
getLogger in interface ServiceMixComponentpublic Registry getRegistry()
getRegistry in interface ServiceMixComponentpublic ServiceUnit getServiceUnit()
protected abstract List getConfiguredEndpoints()
protected abstract Class[] getEndpointClasses()
protected static List asList(Object[] endpoints)
protected void doInit()
throws Exception
doInit in class AsyncBaseLifeCycleException
public void addEndpoint(Endpoint endpoint)
throws Exception
Exception
public void removeEndpoint(Endpoint endpoint)
throws Exception
Exception
protected void validateEndpoint(Endpoint endpoint)
throws javax.jbi.management.DeploymentException
javax.jbi.management.DeploymentException
protected void doStart()
throws Exception
doStart in class AsyncBaseLifeCycleException
protected void doStop()
throws Exception
doStop in class AsyncBaseLifeCycleException
protected void doShutDown()
throws Exception
doShutDown in class AsyncBaseLifeCycleException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||