Class ServiceImp
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConfigComment
,MessageEventGenerator
,Service
,StateManagedComponent
- Direct Known Subclasses:
AddExtendedLoggingContext
,AddFormattedMetadataService
,AddLoggingContext
,AddNamespaceObjectMetadata
,AddPayloadService
,AddTimestampMetadataService
,AggregatingConsumeServiceImpl
,AlwaysFailService
,Base64Service
,BranchingServiceImp
,CacheServiceImpl
,ChangeCharEncodingService
,ClearLoggingContext
,CoreSecurityService
,DuplicateMessageRoutingService
,DuplicateMetadataValueService
,DynamicServiceExecutor
,ExceptionHandlingServiceWrapper
,ExceptionReportService
,FindAndReplaceService
,FlattenMimeParts
,ForEach
,FormDataToMetadata
,GunzipService
,GzipService
,HttpRequestServiceImpl
,IfElse
,InputOutputService
,JdbcService
,JettyResponseService
,JmxOperationImpl
,LoggingServiceImpl
,MessageSplitterServiceImp
,MetadataComparisonService
,MetadataServiceImpl
,MetadataToPayloadService
,MimePartSelector
,MimePartSelectorToMetadata
,MultipartMessageBuilder
,NullService
,OauthTokenGetter
,PayloadFromTemplateService
,PayloadHashingService
,PayloadToMetadataService
,PooledSplitJoinService
,ReadFileService
,RegexpService
,RemoveLoggingContext
,ResolveExpressionService
,RetryingServiceWrapper
,RetryStoreServiceImpl
,ShortCutJettyResponse
,SimpleSequenceNumberService
,StandaloneProducer
,StatelessServiceWrapper
,StopProcessingService
,Switch
,SwitchPayloadService
,SymmetricKeyCryptographyService
,SyntaxRoutingService
,SystemCommandExecutorService
,ThrowExceptionService
,TranscodingService
,UrlEncodedMetadataValues
,UseXmlCharsetAsEncodingService
,Utf8BomRemover
,ValidateMetadataService
,VerifyIdentityService
,WaitService
,While
,WriteMetadataToFilesystem
,XmlTransformService
,XmlValidationService
,XpathObjectMetadataService
,XPathService
Implementation of default / common behaviour for Service
s. Includes basic implementation of
MessageEventGenerator
which returns the fully qualified name of the class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeState
(ComponentState newState) Updates the state for the componentComponentState
.final void
close()
Closes the component.protected abstract void
boolean
If true containers should continue and apply the next configuredService
even if thisService
throws anException
.Create a name for anyMleMarker
that is generated.Create a qualifier for anyMleMarker
that is generated.Get the unique-id that is associated with this component.final void
init()
Initialises the component.protected abstract void
boolean
Returns true if the implementation supports branching.boolean
Returns true if this should be considered an 'end-point' for tracking purposes, otherwise false.void
Request this component is closed.void
Request this component is init'd.void
Request this component is started.void
Request this component is stopped.Returns the last recordComponentState
.void
void
whether or not this service is configured to continue on failure.void
whether or not this service is is a tracking endpoint.void
Sets the unique identifier for thisService
.void
start()
Starts the component.void
stop()
Stop the componentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.ComponentLifecycleExtension
prepare
-
Field Details
-
log
protected transient org.slf4j.Logger log
-
-
Constructor Details
-
ServiceImp
public ServiceImp()Creates a new instance. Default unique ID is autogenerated using
GuidGenerator.getUUID()
.
-
-
Method Details
-
init
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
init
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s
-
initService
- Throws:
CoreException
-
close
public final 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- Specified by:
close
in interfaceComponentLifecycle
-
closeService
protected abstract void closeService() -
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- Specified by:
stop
in interfaceComponentLifecycle
-
start
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.- Specified by:
start
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s
-
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
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.
-
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
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:
s
- thisService
's unique identifier
-
isBranching
public boolean isBranching()Description copied from interface:Service
Returns true if the implementation supports branching.
- Specified by:
isBranching
in interfaceService
- Returns:
- true if the implementation supports branching
- See Also:
-
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
- Returns:
- whether or not this service is configured to continue on failure.
- See Also:
-
setContinueOnFail
whether or not this service is configured to continue on failure.- Parameters:
b
- true/false, default if not specified is false.
-
getIsTrackingEndpoint
-
setIsTrackingEndpoint
whether or not this service is is a tracking endpoint.- Parameters:
b
- true/false, default if not specified is false.
-
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
-
setComments
- Specified by:
setComments
in interfaceConfigComment
-
getComments
- Specified by:
getComments
in interfaceConfigComment
-
changeState
Updates the state for the component
ComponentState
.- Specified by:
changeState
in interfaceStateManagedComponent
-
retrieveComponentState
Returns the last record
ComponentState
.- Specified by:
retrieveComponentState
in interfaceStateManagedComponent
- Returns:
- the current
ComponentState
-
requestInit
Request this component is init'd.
- Specified by:
requestInit
in interfaceStateManagedComponent
- Throws:
CoreException
- wrapping any underlying Exceptions
-
requestStart
Request this component is started.
- Specified by:
requestStart
in interfaceStateManagedComponent
- Throws:
CoreException
- wrapping any underlying Exceptions
-
requestStop
public void requestStop()Request this component is stopped.
- Specified by:
requestStop
in interfaceStateManagedComponent
-
requestClose
public void requestClose()Request this component is closed.
- Specified by:
requestClose
in interfaceStateManagedComponent
-