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 ServiceImpService 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 voidcloseService()voiddoService(AdaptrisMessage msg)Apply the service to the message.ExceptionSerializergetExceptionSerializer()protected voidinitService()voidprepare()Prepare for initialisation.voidsetExceptionSerializer(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:ServiceApply the service to the message.
- Parameters:
msg- theAdaptrisMessageto process- Throws:
ServiceException- wrapping any underlyingExceptions
-
initService
protected void initService() throws CoreException- Specified by:
initServicein classServiceImp- Throws:
CoreException
-
closeService
protected void closeService()
- Specified by:
closeServicein classServiceImp
-
prepare
public void prepare() throws CoreExceptionDescription copied from interface:ComponentLifecycleExtensionPrepare for initialisation.- Throws:
CoreException
-
getExceptionSerializer
public ExceptionSerializer getExceptionSerializer()
-
setExceptionSerializer
public void setExceptionSerializer(ExceptionSerializer exceptionSerializer)
-
-