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 SharedServiceImpl
A 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 void
close()
Closes the component.void
doService(AdaptrisMessage msg)
Apply the service to the message.java.lang.Boolean
getCloneService()
java.lang.String
getLookupName()
Set the name of the service that will be looked up fromSharedComponentList.getServices()
,void
init()
Initialises the component.boolean
isBranching()
Returns true if the implementation supports branching.void
prepare()
Prepare for initialisation.void
setCloneService(java.lang.Boolean cloneService)
void
setLookupName(java.lang.String lookupName)
Set the name of the service that will be looked up fromSharedComponentList.getServices()
,void
start()
Starts the component.void
stop()
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 CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Throws:
CoreException
- wrapping any underlyingException
s
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts 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 underlyingException
s
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop 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 aRuntimeException
may cause unintended consequences
-
close
public void close()
Description copied from interface:ComponentLifecycle
Closes the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeException
may cause unintended consequences
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
isBranching
public boolean isBranching()
Description copied from interface:Service
Returns 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()
,
-
-