Class ThrowExceptionService
java.lang.Object
com.adaptris.core.ServiceImp
com.adaptris.core.services.exception.ThrowExceptionService
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConfigComment
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Throw an exception based on some configured criteria",
tag="service,error-handling")
public class ThrowExceptionService
extends ServiceImp
Throws an exception based on a configurable set of criteria.
Use this service as part of a workflow to throw an exception at a time and place of your choosing (rather than when the exception
actually occurs perhaps). The ServiceException
is generated by concrete implementations of ExceptionGenerator
; if
the generated exception is null, then no exception is thrown.
- See Also:
In the adapter configuration file this class is aliased as throw-exception-service which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
doService
(AdaptrisMessage msg) Apply the service to the message.protected void
void
prepare()
Prepare for initialisation.void
How to generate the exception for throwing.Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getComments, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setComments, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
Constructor Details
-
ThrowExceptionService
public ThrowExceptionService() -
ThrowExceptionService
-
ThrowExceptionService
-
-
Method Details
-
doService
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
initService
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()- Specified by:
closeService
in classServiceImp
-
getExceptionGenerator
-
setExceptionGenerator
How to generate the exception for throwing.- Parameters:
eg
- the generator.
-
prepare
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-