|
||||||||||
| 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.DefaultComponent
public 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 javax.jbi.component.ComponentLifeCycle |
lifeCycle
|
protected org.slf4j.Logger |
logger
|
protected Registry |
registry
|
protected ServiceUnit |
serviceUnit
|
protected BaseServiceUnitManager |
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 | |
|---|---|
DefaultComponent()
|
|
| Method Summary | |
|---|---|
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 |
| 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 |
|---|
protected final transient org.slf4j.Logger logger
protected Registry registry
protected BaseServiceUnitManager serviceUnitManager
protected ServiceUnit serviceUnit
protected javax.jbi.component.ComponentLifeCycle lifeCycle
| 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 org.w3c.dom.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 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.Exception
public 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.DeploymentException
protected void doInit()
throws java.lang.Exception
doInit in class AsyncBaseLifeCyclejava.lang.Exception
protected void doStart()
throws java.lang.Exception
doStart in class AsyncBaseLifeCyclejava.lang.Exception
protected void doStop()
throws java.lang.Exception
doStop in class AsyncBaseLifeCyclejava.lang.Exception
protected void doShutDown()
throws java.lang.Exception
doShutDown in class AsyncBaseLifeCyclejava.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||