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>
incidentHandlers
protected IncidentHandler
mainIncidentHandler
-
Constructor Summary
Constructors Constructor Description CompositeIncidentHandler(IncidentHandler mainIncidentHandler, List<IncidentHandler> incidentHandlers)
Constructor that takes a list ofIncidentHandler
that consume the incident.CompositeIncidentHandler(IncidentHandler mainIncidentHandler, IncidentHandler... incidentHandlers)
Constructor that takes a varargs parameterIncidentHandler
that consume the incident.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(IncidentHandler incidentHandler)
Adds theIncidentHandler
to the list ofIncidentHandler
that consume the incident.void
deleteIncident(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.String
getIncidentHandlerType()
Returns the incident type this handler activates for.Incident
handleIncident(IncidentContext context, String message)
Handle an incident that arose in the context of an execution.protected void
initializeIncidentsHandlers(IncidentHandler mainIncidentHandler, List<IncidentHandler> incidentHandlers)
InitializeincidentHandlers
with data transfered from constructorvoid
resolveIncident(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 ofIncidentHandler
that consume the incident.- Parameters:
mainIncidentHandler
- the main incident handlerIncidentHandler
that consume the incident and return result.incidentHandlers
- the list ofIncidentHandler
that consume the incident.
-
CompositeIncidentHandler
public CompositeIncidentHandler(IncidentHandler mainIncidentHandler, IncidentHandler... incidentHandlers)
Constructor that takes a varargs parameterIncidentHandler
that consume the incident.- Parameters:
mainIncidentHandler
- the main incident handlerIncidentHandler
that consume the incident and return result.incidentHandlers
- the list ofIncidentHandler
that consume the incident.
-
-
Method Detail
-
initializeIncidentsHandlers
protected void initializeIncidentsHandlers(IncidentHandler mainIncidentHandler, List<IncidentHandler> incidentHandlers)
InitializeincidentHandlers
with data transfered from constructor- Parameters:
incidentHandlers
-
-
add
public void add(IncidentHandler incidentHandler)
Adds theIncidentHandler
to the list ofIncidentHandler
that consume the incident.- Parameters:
incidentHandler
- theIncidentHandler
that consume the incident.
-
getIncidentHandlerType
public String getIncidentHandlerType()
Description copied from interface:IncidentHandler
Returns the incident type this handler activates for.- Specified by:
getIncidentHandlerType
in interfaceIncidentHandler
-
handleIncident
public Incident handleIncident(IncidentContext context, String message)
Description copied from interface:IncidentHandler
Handle an incident that arose in the context of an execution.- Specified by:
handleIncident
in interfaceIncidentHandler
-
resolveIncident
public void resolveIncident(IncidentContext context)
Description copied from interface:IncidentHandler
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.- Specified by:
resolveIncident
in interfaceIncidentHandler
-
deleteIncident
public void deleteIncident(IncidentContext context)
Description copied from interface:IncidentHandler
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. The implementation receives this callback to enable it to delete any open incidents that may exist.- Specified by:
deleteIncident
in interfaceIncidentHandler
-
-