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 EventHandler
eventHandler
protected org.slf4j.Logger
log
-
Constructor Summary
Constructors Constructor Description SharedServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyService(Service s, AdaptrisMessage msg)
void
changeState(ComponentState newState)
Updates the state for the componentComponentState
.boolean
continueOnFailure()
If true containers should continue and apply the next configuredService
even if thisService
throws anException
.java.lang.String
createName()
Create a name for anyMleMarker
that is generated.java.lang.String
createQualifier()
Create a qualifier for anyMleMarker
that is generated.protected Service
deepClone(Service lookedUpService)
java.lang.Boolean
getContinueOnFail()
java.lang.Boolean
getIsTrackingEndpoint()
java.lang.String
getUniqueId()
Get the unique-id that is associated with this component.boolean
isTrackingEndpoint()
Returns true if this should be considered an 'end-point' for tracking purposes, otherwise false.void
registerEventHandler(EventHandler eh)
Register the current event handler against this component.void
requestClose()
Request this component is closed.void
requestInit()
Request this component is init'd.void
requestStart()
Request this component is started.void
requestStop()
Request this component is stopped.ComponentState
retrieveComponentState()
Returns the last recordeComponentState
.void
setContinueOnFail(java.lang.Boolean b)
void
setIsTrackingEndpoint(java.lang.Boolean b)
void
setUniqueId(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:EventHandlerAware
Register the current event handler against this component.- Specified by:
registerEventHandler
in interfaceEventHandlerAware
- Parameters:
eh
- the event handler currently in use.
-
changeState
public void changeState(ComponentState newState)
Description copied from interface:StateManagedComponent
Updates the state for the component
ComponentState
.- Specified by:
changeState
in interfaceStateManagedComponent
-
retrieveComponentState
public ComponentState retrieveComponentState()
Description copied from interface:StateManagedComponent
Returns the last recorde
ComponentState
.- Specified by:
retrieveComponentState
in interfaceStateManagedComponent
- Returns:
- the current
ComponentState
-
requestInit
public void requestInit() throws CoreException
Description copied from interface:StateManagedComponent
Request this component is init'd.
- Specified by:
requestInit
in interfaceStateManagedComponent
- Throws:
CoreException
- wrapping any underlying Exceptions
-
requestStart
public void requestStart() throws CoreException
Description copied from interface:StateManagedComponent
Request this component is started.
- Specified by:
requestStart
in interfaceStateManagedComponent
- Throws:
CoreException
- wrapping any underlying Exceptions
-
requestStop
public void requestStop()
Description copied from interface:StateManagedComponent
Request this component is stopped.
- Specified by:
requestStop
in interfaceStateManagedComponent
-
requestClose
public void requestClose()
Description copied from interface:StateManagedComponent
Request this component is closed.
- Specified by:
requestClose
in interfaceStateManagedComponent
-
getUniqueId
public java.lang.String getUniqueId()
Description copied from interface:AdaptrisComponent
Get the unique-id that is associated with this component.- Specified by:
getUniqueId
in interfaceAdaptrisComponent
- Returns:
- the unique-id
-
setUniqueId
public void setUniqueId(java.lang.String uniqueId)
Description copied from interface:Service
Sets the unique identifier for this
Service
. These unique identifiers are optional but maybe required by some implementations ofServiceCollection
.- Specified by:
setUniqueId
in interfaceService
- Parameters:
uniqueId
- thisService
's unique identifier
-
isTrackingEndpoint
public boolean isTrackingEndpoint()
Description copied from interface:MessageEventGenerator
Returns true if this should be considered an 'end-point' for tracking purposes, otherwise false.
- Specified by:
isTrackingEndpoint
in interfaceMessageEventGenerator
- Returns:
- true if this should be considered an 'end-point' for tracking purposes, otherwise false
-
continueOnFailure
public boolean continueOnFailure()
Description copied from interface:Service
If true containers should continue and apply the next configured
Service
even if thisService
throws anException
.- Specified by:
continueOnFailure
in 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:MessageEventGenerator
Create a name for anyMleMarker
that is generated.The default implementation is to return the classname of the component in question.
* @return the name for anyMleMarker
that is generated.- Specified by:
createName
in interfaceMessageEventGenerator
-
createQualifier
public java.lang.String createQualifier()
Description copied from interface:MessageEventGenerator
Create a qualifier for anyMleMarker
that 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:
createQualifier
in interfaceMessageEventGenerator
- Returns:
- the qualifier for any
MleMarker
that is generated.
-
-