Class ExceptionReportService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.exception.ExceptionReportService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Generate a report based on the current exception", tag="service,error-handling") public class ExceptionReportService extends ServiceImp
Service that takes an exception in object metadata and serializes that into the AdaptrisMessage payload.In some scenarios (e.g. handling request reply scenarios), rather than directly handling the message exception in the adapter, it may be required to report back to the back-end application that an exception has occured along with the problem document.
- See Also:
ExceptionSerializer
,CoreConstants.OBJ_METADATA_EXCEPTION
In the adapter configuration file this class is aliased as exception-report-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
Constructors Constructor Description ExceptionReportService()
ExceptionReportService(ExceptionSerializer e)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeService()
void
doService(AdaptrisMessage msg)
Apply the service to the message.ExceptionSerializer
getExceptionSerializer()
protected void
initService()
void
prepare()
Prepare for initialisation.void
setExceptionSerializer(ExceptionSerializer exceptionSerializer)
-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
-
-
-
Constructor Detail
-
ExceptionReportService
public ExceptionReportService()
-
ExceptionReportService
public ExceptionReportService(ExceptionSerializer e)
-
-
Method Detail
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
initService
protected void initService() throws CoreException
- Specified by:
initService
in classServiceImp
- Throws:
CoreException
-
closeService
protected void closeService()
- Specified by:
closeService
in classServiceImp
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Throws:
CoreException
-
getExceptionSerializer
public ExceptionSerializer getExceptionSerializer()
-
setExceptionSerializer
public void setExceptionSerializer(ExceptionSerializer exceptionSerializer)
-
-