public abstract class SharedServiceImpl extends SharedComponent implements Service, EventHandlerAware
Modifier and Type | Field and Description |
---|---|
protected EventHandler |
eventHandler |
protected org.slf4j.Logger |
log |
CONFIRMATION_ID_KEY
Constructor and Description |
---|
SharedServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyService(Service s,
AdaptrisMessage msg) |
void |
changeState(ComponentState newState)
Updates the state for the component
ComponentState . |
boolean |
continueOnFailure()
If true containers should continue and apply the next configured
Service even if this Service throws an
Exception . |
java.lang.String |
createName()
Create a name for any
MleMarker that is generated. |
java.lang.String |
createQualifier()
Create a qualifier for any
MleMarker that is generated. |
protected Service |
deepClone(Service lookedUpService) |
java.lang.Boolean |
getContinueOnFail() |
java.lang.Boolean |
getIsTrackingEndpoint() |
java.lang.String |
getLookupName()
Returns the exact name to bind this object to our
Context . |
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 recorde
ComponentState . |
void |
setContinueOnFail(java.lang.Boolean b) |
void |
setIsTrackingEndpoint(java.lang.Boolean b) |
void |
setLookupName(java.lang.String lookupName) |
void |
setUniqueId(java.lang.String uniqueId)
Sets the unique identifier for this
Service . |
triggerJndiLookup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doService, isBranching
close, init, start, stop
prepare
protected transient EventHandler eventHandler
protected transient org.slf4j.Logger log
protected void applyService(Service s, AdaptrisMessage msg) throws ServiceException
ServiceException
protected Service deepClone(Service lookedUpService) throws CoreException
CoreException
public java.lang.String getLookupName()
JndiBindable
Context
.
Specifying a lookupName will not be modified at all when binding to jndi. Therefore you may want to prepend your own chosen subcontexts in this name e.g. "comp/env/"
getLookupName
in interface JndiBindable
public void setLookupName(java.lang.String lookupName)
public void registerEventHandler(EventHandler eh)
EventHandlerAware
registerEventHandler
in interface EventHandlerAware
eh
- the event handler currently in use.public void changeState(ComponentState newState)
StateManagedComponent
Updates the state for the component ComponentState
.
changeState
in interface StateManagedComponent
public ComponentState retrieveComponentState()
StateManagedComponent
Returns the last recorde ComponentState
.
retrieveComponentState
in interface StateManagedComponent
ComponentState
public void requestInit() throws CoreException
StateManagedComponent
Request this component is init'd.
requestInit
in interface StateManagedComponent
CoreException
- wrapping any underlying Exceptionspublic void requestStart() throws CoreException
StateManagedComponent
Request this component is started.
requestStart
in interface StateManagedComponent
CoreException
- wrapping any underlying Exceptionspublic void requestStop()
StateManagedComponent
Request this component is stopped.
requestStop
in interface StateManagedComponent
public void requestClose()
StateManagedComponent
Request this component is closed.
requestClose
in interface StateManagedComponent
public java.lang.String getUniqueId()
AdaptrisComponent
getUniqueId
in interface AdaptrisComponent
public void setUniqueId(java.lang.String uniqueId)
Service
Sets the unique identifier for this Service
. These unique
identifiers are optional but maybe required by some implementations of
ServiceCollection
.
setUniqueId
in interface Service
uniqueId
- this Service
's unique identifierpublic boolean isTrackingEndpoint()
MessageEventGenerator
Returns true if this should be considered an 'end-point' for tracking purposes, otherwise false.
isTrackingEndpoint
in interface MessageEventGenerator
public boolean continueOnFailure()
Service
If true containers should continue and apply the next configured
Service
even if this Service
throws an
Exception
.
continueOnFailure
in interface Service
public java.lang.Boolean getContinueOnFail()
public void setContinueOnFail(java.lang.Boolean b)
public java.lang.Boolean getIsTrackingEndpoint()
public void setIsTrackingEndpoint(java.lang.Boolean b)
public java.lang.String createName()
MessageEventGenerator
MleMarker
that is generated.
The default implementation is to return the classname of the component in question.
* @return the name for anyMleMarker
that is generated.createName
in interface MessageEventGenerator
public java.lang.String createQualifier()
MessageEventGenerator
MleMarker
that is generated.
The default implementation is to return the unique-id of the component in question, or the empty string if not configured
createQualifier
in interface MessageEventGenerator
MleMarker
that is generated.