Class SharedServiceImpl
- java.lang.Object
-
- com.adaptris.core.SharedComponent
-
- com.adaptris.core.SharedServiceImpl
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,EventHandlerAware,MessageEventGenerator,Service,StateManagedComponent
- Direct Known Subclasses:
DynamicSharedService,SharedService
public abstract class SharedServiceImpl extends SharedComponent implements Service, EventHandlerAware
-
-
Field Summary
Fields Modifier and Type Field Description protected EventHandlereventHandlerprotected org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description SharedServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyService(Service s, AdaptrisMessage msg)voidchangeState(ComponentState newState)Updates the state for the componentComponentState.booleancontinueOnFailure()If true containers should continue and apply the next configuredServiceeven if thisServicethrows anException.java.lang.StringcreateName()Create a name for anyMleMarkerthat is generated.java.lang.StringcreateQualifier()Create a qualifier for anyMleMarkerthat is generated.protected ServicedeepClone(Service lookedUpService)java.lang.BooleangetContinueOnFail()java.lang.BooleangetIsTrackingEndpoint()java.lang.StringgetUniqueId()Get the unique-id that is associated with this component.booleanisTrackingEndpoint()Returns true if this should be considered an 'end-point' for tracking purposes, otherwise false.voidregisterEventHandler(EventHandler eh)Register the current event handler against this component.voidrequestClose()Request this component is closed.voidrequestInit()Request this component is init'd.voidrequestStart()Request this component is started.voidrequestStop()Request this component is stopped.ComponentStateretrieveComponentState()Returns the last recordeComponentState.voidsetContinueOnFail(java.lang.Boolean b)voidsetIsTrackingEndpoint(java.lang.Boolean b)voidsetUniqueId(java.lang.String uniqueId)Sets the unique identifier for thisService.-
Methods inherited from class com.adaptris.core.SharedComponent
triggerJndiLookup
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
-
Methods inherited from interface com.adaptris.core.ComponentLifecycleExtension
prepare
-
Methods inherited from interface com.adaptris.core.Service
doService, isBranching
-
-
-
-
Field Detail
-
eventHandler
protected transient EventHandler eventHandler
-
log
protected transient org.slf4j.Logger log
-
-
Method Detail
-
applyService
protected void applyService(Service s, AdaptrisMessage msg) throws ServiceException
- Throws:
ServiceException
-
deepClone
protected Service deepClone(Service lookedUpService) throws CoreException
- Throws:
CoreException
-
registerEventHandler
public void registerEventHandler(EventHandler eh)
Description copied from interface:EventHandlerAwareRegister the current event handler against this component.- Specified by:
registerEventHandlerin interfaceEventHandlerAware- Parameters:
eh- the event handler currently in use.
-
changeState
public void changeState(ComponentState newState)
Description copied from interface:StateManagedComponentUpdates the state for the component
ComponentState.- Specified by:
changeStatein interfaceStateManagedComponent
-
retrieveComponentState
public ComponentState retrieveComponentState()
Description copied from interface:StateManagedComponentReturns the last recorde
ComponentState.- Specified by:
retrieveComponentStatein interfaceStateManagedComponent- Returns:
- the current
ComponentState
-
requestInit
public void requestInit() throws CoreExceptionDescription copied from interface:StateManagedComponentRequest this component is init'd.
- Specified by:
requestInitin interfaceStateManagedComponent- Throws:
CoreException- wrapping any underlying Exceptions
-
requestStart
public void requestStart() throws CoreExceptionDescription copied from interface:StateManagedComponentRequest this component is started.
- Specified by:
requestStartin interfaceStateManagedComponent- Throws:
CoreException- wrapping any underlying Exceptions
-
requestStop
public void requestStop()
Description copied from interface:StateManagedComponentRequest this component is stopped.
- Specified by:
requestStopin interfaceStateManagedComponent
-
requestClose
public void requestClose()
Description copied from interface:StateManagedComponentRequest this component is closed.
- Specified by:
requestClosein interfaceStateManagedComponent
-
getUniqueId
public java.lang.String getUniqueId()
Description copied from interface:AdaptrisComponentGet the unique-id that is associated with this component.- Specified by:
getUniqueIdin interfaceAdaptrisComponent- Returns:
- the unique-id
-
setUniqueId
public void setUniqueId(java.lang.String uniqueId)
Description copied from interface:ServiceSets the unique identifier for this
Service. These unique identifiers are optional but maybe required by some implementations ofServiceCollection.- Specified by:
setUniqueIdin interfaceService- Parameters:
uniqueId- thisService's unique identifier
-
isTrackingEndpoint
public boolean isTrackingEndpoint()
Description copied from interface:MessageEventGeneratorReturns true if this should be considered an 'end-point' for tracking purposes, otherwise false.
- Specified by:
isTrackingEndpointin interfaceMessageEventGenerator- Returns:
- true if this should be considered an 'end-point' for tracking purposes, otherwise false
-
continueOnFailure
public boolean continueOnFailure()
Description copied from interface:ServiceIf true containers should continue and apply the next configured
Serviceeven if thisServicethrows anException.- Specified by:
continueOnFailurein interfaceService- Returns:
- continueOnFail
-
getContinueOnFail
public java.lang.Boolean getContinueOnFail()
-
setContinueOnFail
public void setContinueOnFail(java.lang.Boolean b)
-
getIsTrackingEndpoint
public java.lang.Boolean getIsTrackingEndpoint()
-
setIsTrackingEndpoint
public void setIsTrackingEndpoint(java.lang.Boolean b)
-
createName
public java.lang.String createName()
Description copied from interface:MessageEventGeneratorCreate a name for anyMleMarkerthat is generated.The default implementation is to return the classname of the component in question.
* @return the name for anyMleMarkerthat is generated.- Specified by:
createNamein interfaceMessageEventGenerator
-
createQualifier
public java.lang.String createQualifier()
Description copied from interface:MessageEventGeneratorCreate a qualifier for anyMleMarkerthat is generated.The default implementation is to return the unique-id of the component in question, or the empty string if not configured
- Specified by:
createQualifierin interfaceMessageEventGenerator- Returns:
- the qualifier for any
MleMarkerthat is generated.
-
-