Class CompositeIncidentHandler
- java.lang.Object
-
- org.camunda.bpm.engine.impl.incident.CompositeIncidentHandler
-
- All Implemented Interfaces:
IncidentHandler
public class CompositeIncidentHandler extends Object implements IncidentHandler
A composite incident handler that handles incidents of a certain type by the multiple handlers. The result of handling depends on main handler.
- See Also:
mainIncidentHandler,IncidentHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected List<IncidentHandler>incidentHandlersprotected IncidentHandlermainIncidentHandler
-
Constructor Summary
Constructors Constructor Description CompositeIncidentHandler(IncidentHandler mainIncidentHandler, List<IncidentHandler> incidentHandlers)Constructor that takes a list ofIncidentHandlerthat consume the incident.CompositeIncidentHandler(IncidentHandler mainIncidentHandler, IncidentHandler... incidentHandlers)Constructor that takes a varargs parameterIncidentHandlerthat consume the incident.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(IncidentHandler incidentHandler)Adds theIncidentHandlerto the list ofIncidentHandlerthat consume the incident.voiddeleteIncident(IncidentContext context)Called in situations in which an incident handler may wish to delete existing incidents Example: when a scope is ended or a job is deleted.StringgetIncidentHandlerType()Returns the incident type this handler activates for.IncidenthandleIncident(IncidentContext context, String message)Handle an incident that arose in the context of an execution.protected voidinitializeIncidentsHandlers(IncidentHandler mainIncidentHandler, List<IncidentHandler> incidentHandlers)InitializeincidentHandlerswith data transfered from constructorvoidresolveIncident(IncidentContext context)Called in situations in which an incident handler may wish to resolve existing incidents The implementation receives this callback to enable it to resolve any open incidents that may exist.
-
-
-
Field Detail
-
mainIncidentHandler
protected IncidentHandler mainIncidentHandler
-
incidentHandlers
protected final List<IncidentHandler> incidentHandlers
-
-
Constructor Detail
-
CompositeIncidentHandler
public CompositeIncidentHandler(IncidentHandler mainIncidentHandler, List<IncidentHandler> incidentHandlers)
Constructor that takes a list ofIncidentHandlerthat consume the incident.- Parameters:
mainIncidentHandler- the main incident handlerIncidentHandlerthat consume the incident and return result.incidentHandlers- the list ofIncidentHandlerthat consume the incident.
-
CompositeIncidentHandler
public CompositeIncidentHandler(IncidentHandler mainIncidentHandler, IncidentHandler... incidentHandlers)
Constructor that takes a varargs parameterIncidentHandlerthat consume the incident.- Parameters:
mainIncidentHandler- the main incident handlerIncidentHandlerthat consume the incident and return result.incidentHandlers- the list ofIncidentHandlerthat consume the incident.
-
-
Method Detail
-
initializeIncidentsHandlers
protected void initializeIncidentsHandlers(IncidentHandler mainIncidentHandler, List<IncidentHandler> incidentHandlers)
InitializeincidentHandlerswith data transfered from constructor- Parameters:
incidentHandlers-
-
add
public void add(IncidentHandler incidentHandler)
Adds theIncidentHandlerto the list ofIncidentHandlerthat consume the incident.- Parameters:
incidentHandler- theIncidentHandlerthat consume the incident.
-
getIncidentHandlerType
public String getIncidentHandlerType()
Description copied from interface:IncidentHandlerReturns the incident type this handler activates for.- Specified by:
getIncidentHandlerTypein interfaceIncidentHandler
-
handleIncident
public Incident handleIncident(IncidentContext context, String message)
Description copied from interface:IncidentHandlerHandle an incident that arose in the context of an execution.- Specified by:
handleIncidentin interfaceIncidentHandler
-
resolveIncident
public void resolveIncident(IncidentContext context)
Description copied from interface:IncidentHandlerCalled in situations in which an incident handler may wish to resolve existing incidents The implementation receives this callback to enable it to resolve any open incidents that may exist.- Specified by:
resolveIncidentin interfaceIncidentHandler
-
deleteIncident
public void deleteIncident(IncidentContext context)
Description copied from interface:IncidentHandlerCalled in situations in which an incident handler may wish to delete existing incidents Example: when a scope is ended or a job is deleted. The implementation receives this callback to enable it to delete any open incidents that may exist.- Specified by:
deleteIncidentin interfaceIncidentHandler
-
-