@ComponentProfile(summary="A configurable exception handling instance",
tag="error-handling,base")
public class StandardProcessingExceptionHandler
extends RootProcessingExceptionHandler
implements EventHandlerAware
Service,
ServiceListIn the adapter configuration file this class is aliased as standard-processing-exception-handler which is the preferred alternative to the fully qualified classname when building your configuration.
log| Constructor and Description |
|---|
StandardProcessingExceptionHandler()
Creates a new instance.
|
StandardProcessingExceptionHandler(Service... services) |
StandardProcessingExceptionHandler(ServiceList service) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the component.
|
Service |
getProcessingExceptionService()
Get the service(s) that will be applied.
|
void |
handleProcessingException(AdaptrisMessage msg)
Handles error messages from Workflows by sending them to the configured
error producer.
|
boolean |
hasConfiguredBehaviour()
Simply report back to the owning component whether or not this ProcessingExceptionHandler is actually going to do anything.
|
void |
init()
Initialises the component.
|
protected void |
logErrorMessage(Service p,
AdaptrisMessage m) |
void |
prepare()
Prepare for initialisation.
|
protected java.util.Map<java.lang.String,Workflow> |
registeredWorkflows()
Get the map of registered workflows.
|
void |
registerEventHandler(EventHandler eh)
Register the current event handler against this component.
|
void |
registerWorkflow(Workflow w)
Register a workflow against this error handler.
|
void |
setProcessingExceptionService(Service s)
Set the service(s) that will be applied.
|
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
changeState, getAlwaysHandleException, getParent, getUniqueId, notifyParent, onChildError, registerDigester, registerParent, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveDigester, setAlwaysHandleException, setUniqueIdpublic StandardProcessingExceptionHandler()
Creates a new instance. Defaults to null implementations.
public StandardProcessingExceptionHandler(ServiceList service)
public StandardProcessingExceptionHandler(Service... services)
public void handleProcessingException(AdaptrisMessage msg)
Handles error messages from Workflows by sending them to the configured error producer. The best practice would be for the service to write the message to the filesystem, which is pretty unlikely to fail.
handleProcessingException in interface ProcessingExceptionHandlermsg - the AdaptrisMessage to handlepublic void init()
throws CoreException
ComponentLifecycleComponent initialisation includes config verification, creation of connections etc.
init in interface ComponentLifecycleCoreException - wrapping any underlying Exceptionspublic 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 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 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 ComponentLifecyclepublic void prepare()
throws CoreException
ComponentLifecycleExtensionprepare in interface ComponentLifecycleExtensionCoreExceptionprotected void logErrorMessage(Service p, AdaptrisMessage m)
public Service getProcessingExceptionService()
public void setProcessingExceptionService(Service s)
s - the servicepublic void registerWorkflow(Workflow w)
registerWorkflow in interface ProcessingExceptionHandlerw - the workflow to register.protected java.util.Map<java.lang.String,Workflow> registeredWorkflows()
The workflows are keyed against their unique-id.
public boolean hasConfiguredBehaviour()
ProcessingExceptionHandlerhasConfiguredBehaviour in interface ProcessingExceptionHandlerpublic void registerEventHandler(EventHandler eh)
EventHandlerAwareregisterEventHandler in interface EventHandlerAwareeh - the event handler currently in use.