Class SharedService
- java.lang.Object
-
- com.adaptris.core.SharedComponent
-
- com.adaptris.core.SharedServiceImpl
-
- com.adaptris.core.SharedService
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,EventHandlerAware,MessageEventGenerator,Service,StateManagedComponent
@ComponentProfile(summary="A Service that refers to another Service configured elsewhere", tag="service") public class SharedService extends SharedServiceImplA Service instance that references a Service made available via
SharedComponentList.By default the looked-up service is deep cloned before being loaded into your workflows.
You can turn off cloning by simply setting "clone-service=true".In the adapter configuration file this class is aliased as shared-service which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.SharedServiceImpl
eventHandler, log
-
-
Constructor Summary
Constructors Constructor Description SharedService()SharedService(java.lang.String lookupName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the component.voiddoService(AdaptrisMessage msg)Apply the service to the message.java.lang.BooleangetCloneService()java.lang.StringgetLookupName()Set the name of the service that will be looked up fromSharedComponentList.getServices(),voidinit()Initialises the component.booleanisBranching()Returns true if the implementation supports branching.voidprepare()Prepare for initialisation.voidsetCloneService(java.lang.Boolean cloneService)voidsetLookupName(java.lang.String lookupName)Set the name of the service that will be looked up fromSharedComponentList.getServices(),voidstart()Starts the component.voidstop()Stop the component-
Methods inherited from class com.adaptris.core.SharedServiceImpl
applyService, changeState, continueOnFailure, createName, createQualifier, deepClone, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, isTrackingEndpoint, registerEventHandler, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
-
Methods inherited from class com.adaptris.core.SharedComponent
triggerJndiLookup
-
-
-
-
Method Detail
-
init
public void init() throws CoreExceptionDescription copied from interface:ComponentLifecycleInitialises the component.Component initialisation includes config verification, creation of connections etc.
- Throws:
CoreException- wrapping any underlyingExceptions
-
start
public void start() throws CoreExceptionDescription copied from interface:ComponentLifecycleStarts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer, calling start will begin message delivery.- Throws:
CoreException- wrapping any underlyingExceptions
-
stop
public void stop()
Description copied from interface:ComponentLifecycleStop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer, calling stop will pause message delivery. Throwing aRuntimeExceptionmay cause unintended consequences
-
close
public void close()
Description copied from interface:ComponentLifecycleCloses the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeExceptionmay cause unintended consequences
-
prepare
public void prepare() throws CoreExceptionDescription copied from interface:ComponentLifecycleExtensionPrepare for initialisation.- Throws:
CoreException
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:ServiceApply the service to the message.
- Parameters:
msg- theAdaptrisMessageto process- Throws:
ServiceException- wrapping any underlyingExceptions
-
isBranching
public boolean isBranching()
Description copied from interface:ServiceReturns true if the implementation supports branching.
- Returns:
- true if the implementation supports branching
- See Also:
BranchingServiceCollection
-
getCloneService
public java.lang.Boolean getCloneService()
-
setCloneService
public void setCloneService(java.lang.Boolean cloneService)
-
getLookupName
public java.lang.String getLookupName()
Set the name of the service that will be looked up fromSharedComponentList.getServices(),
-
setLookupName
public void setLookupName(java.lang.String lookupName)
Set the name of the service that will be looked up fromSharedComponentList.getServices(),
-
-