public abstract class ServiceImp extends java.lang.Object implements Service
 Implementation of default / common behaviour for Services.
 Includes basic implementation of MessageEventGenerator which
 returns the fully qualified name of the class.
 
| Modifier and Type | Field and Description | 
|---|---|
protected org.slf4j.Logger | 
log  | 
| Constructor and Description | 
|---|
ServiceImp()
 Creates a new instance. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
changeState(ComponentState newState)
 Updates the state for the component  
ComponentState. | 
void | 
close()
Closes the component. 
 | 
protected abstract void | 
closeService()  | 
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. | 
java.lang.Boolean | 
getContinueOnFail()  | 
java.lang.Boolean | 
getIsTrackingEndpoint()  | 
java.lang.String | 
getUniqueId()
Get the unique-id that is associated with this component. 
 | 
void | 
init()
Initialises the component. 
 | 
protected abstract void | 
initService()  | 
boolean | 
isBranching()
 Returns true if the implementation supports branching. 
 | 
boolean | 
isTrackingEndpoint()
 Returns true if this should be considered an 'end-point' for tracking
 purposes, otherwise false. 
 | 
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 record  
ComponentState. | 
void | 
setContinueOnFail(java.lang.Boolean b)
whether or not this service is configured to continue on failure. 
 | 
void | 
setIsTrackingEndpoint(java.lang.Boolean b)
whether or not this service is is a tracking endpoint. 
 | 
void | 
setUniqueId(java.lang.String s)
 Sets the unique identifier for this  
Service. | 
void | 
start()
Starts the component. 
 | 
void | 
stop()
Stop the component 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpreparepublic ServiceImp()
 Creates a new instance. Default unique ID is autogenerated using GuidGenerator.getUUID().
 
public final void init()
                throws CoreException
ComponentLifecycleComponent initialisation includes config verification, creation of connections etc.
init in interface ComponentLifecycleCoreException - wrapping any underlying Exceptionsprotected abstract void initService()
                             throws CoreException
CoreExceptionpublic final void close()
ComponentLifecycle
 A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException may
 cause unintended consequences
 
close in interface ComponentLifecycleprotected abstract void closeService()
public void stop()
ComponentLifecycle
 A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer, calling stop
 will pause message delivery. Throwing a RuntimeException may cause unintended consequences
 
stop in interface ComponentLifecyclepublic void start()
           throws CoreException
ComponentLifecycle
 Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer, calling start
 will begin message delivery.
 
start in interface ComponentLifecycleCoreException - wrapping any underlying Exceptionspublic java.lang.String createName()
MessageEventGeneratorMleMarker 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 MessageEventGeneratorpublic java.lang.String createQualifier()
MessageEventGeneratorMleMarker 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 MessageEventGeneratorMleMarker that is generated.public java.lang.String getUniqueId()
AdaptrisComponentgetUniqueId in interface AdaptrisComponentpublic void setUniqueId(java.lang.String s)
Service
 Sets the unique identifier for this Service. These unique
 identifiers are optional but maybe required by some implementations of
 ServiceCollection.
 
setUniqueId in interface Services - this Service's unique identifierpublic boolean isBranching()
ServiceReturns true if the implementation supports branching.
isBranching in interface ServiceBranchingServiceCollectionpublic boolean continueOnFailure()
Service
 If true containers should continue and apply the next configured
 Service even if this Service throws an
 Exception.
 
continueOnFailure in interface Servicepublic java.lang.Boolean getContinueOnFail()
continueOnFailure()public void setContinueOnFail(java.lang.Boolean b)
b - true/false, default if not specified is false.public java.lang.Boolean getIsTrackingEndpoint()
public void setIsTrackingEndpoint(java.lang.Boolean b)
b - true/false, default if not specified is false.public boolean isTrackingEndpoint()
MessageEventGeneratorReturns true if this should be considered an 'end-point' for tracking purposes, otherwise false.
isTrackingEndpoint in interface MessageEventGeneratorpublic void changeState(ComponentState newState)
 Updates the state for the component ComponentState.
 
changeState in interface StateManagedComponentpublic ComponentState retrieveComponentState()
 Returns the last record ComponentState.
 
retrieveComponentState in interface StateManagedComponentComponentStatepublic void requestInit()
                 throws CoreException
Request this component is init'd.
requestInit in interface StateManagedComponentCoreException - wrapping any underlying Exceptionspublic void requestStart()
                  throws CoreException
Request this component is started.
requestStart in interface StateManagedComponentCoreException - wrapping any underlying Exceptionspublic void requestStop()
Request this component is stopped.
requestStop in interface StateManagedComponentpublic void requestClose()
Request this component is closed.
requestClose in interface StateManagedComponent