public class EventSourceAdder
extends de.aristaflow.adept2.core.automaticclient.ItemHandler
ItemHandler for adding an event source for a specific
worklist item. Since problems when adding an event source are rather common,
this ItemHandler allows for asynchronously adding an event
source and thus retrying several times. Note that usually the first run should be a synchronous run (by the worklist handler) to prevent problems with asynchronous worklist updates changing the activity state.
| Modifier and Type | Field and Description |
|---|---|
protected int |
currentRun
The number of times the event source has been tried to add.
|
static long |
EVENT_SOURCE_ADDING_FAILED_CODE
Code for adding the event source failed finally.
|
static java.lang.String |
EVENT_SOURCE_ADDING_FAILED_STATE
State for adding the event source failed finally.
|
protected ActivityEventManager |
eventManager
The event manager which to use for starting and failing the activity in
case adding the event source fails finally.
|
protected WorklistHandler |
handler
The worklist handler for adding the event source.
|
protected java.util.Collection<de.aristaflow.adept2.core.automaticclient.ItemHandler> |
pendingItems
A collection tracking all items for which currently an event source is
about to be added.
|
protected java.util.concurrent.ScheduledExecutorService |
pollService
The poll service for rescheduling event source adders in case adding the
event source fails (again).
|
protected int |
retries
The maximum number of tries to add the event source before the
corresponding activity will be failed.
|
protected long |
retryDelay
The time in milliseconds before retrying to add the event source.
|
| Constructor and Description |
|---|
EventSourceAdder(ClientWorklistItem item,
int retries,
long retryDelay,
WorklistHandler handler,
java.util.Collection<de.aristaflow.adept2.core.automaticclient.ItemHandler> pendingSelected,
java.util.concurrent.ScheduledExecutorService pollService,
ActivityEventManager eventManager,
LogService logService)
Creates a new worklist item handler for adding event soures for specific
worklist items.
|
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
public static final java.lang.String EVENT_SOURCE_ADDING_FAILED_STATE
public static final long EVENT_SOURCE_ADDING_FAILED_CODE
protected final WorklistHandler handler
protected final java.util.Collection<de.aristaflow.adept2.core.automaticclient.ItemHandler> pendingItems
ItemHandler.invalidate() worklist items while they
are pending for handling.protected final java.util.concurrent.ScheduledExecutorService pollService
protected final ActivityEventManager eventManager
protected int currentRun
protected int retries
protected long retryDelay
public EventSourceAdder(ClientWorklistItem item, int retries, long retryDelay, WorklistHandler handler, java.util.Collection<de.aristaflow.adept2.core.automaticclient.ItemHandler> pendingSelected, java.util.concurrent.ScheduledExecutorService pollService, ActivityEventManager eventManager, LogService logService)
item - The worklist for which to add an event source.retries - The maximum number of tries to add the event source before
the corresponding activity will be failed.retryDelay - The time in milliseconds before retrying to add the event
source.handler - The worklist handler for adding the event source.pendingSelected - A collection tracking all items for which currently
an event source is about to be added. This worklist items are
usually selected.pollService - The poll service for rescheduling event source adders in
case adding the event source fails (again).eventManager - The event manager which to use for starting and failing
the activity in case adding the event source fails finally.logService - The log service to retrieve the logger from.