public class WorklistHandler
extends de.aristaflow.adept2.core.automaticclient.AbstractWorklistHandler
WorklistHandler creates event sources for worklist items
with activities that wait for an event.| Modifier and Type | Field and Description |
|---|---|
protected int |
addSourceRetries
The maximum number of tries to add an event source before the
corresponding activity will be failed.
|
protected long |
addSourceRetryDelay
The time in milliseconds before retrying to add the event source.
|
protected AbstractEventManager |
eventManager
The event manager for registering and unregistering events and for
providing session tokens.
|
protected java.util.Collection<de.aristaflow.adept2.core.automaticclient.ItemHandler> |
pendingSelected
The handler which currently try to add an event source for a specific
worklist item.
|
protected Registry |
registry
The registry for retrieving the appropriate data source.
|
protected java.util.Map<EBPInstanceReference,Triple<java.lang.String,java.lang.String,java.lang.String>> |
runningItems
Mapping of the EBP instance reference to the corresponding execution
session.
|
active, CONF_CREATE_WORKLIST_RETRY_DELAY, CONF_CREATE_WORKLIST_SILENT_COUNT, CONF_PING_WLM_INTERVAL, CONF_RECONNECT_LOG_LEVEL, CONF_RECONNECT_WLM_INTERVAL, CONF_RESUME_ONLY, CONF_UPDATE_INTERVAL, CONF_WORKER_PRIORITY, createWorklistRetryDelay, createWorklistSilentCount, drainWork, logger, receivedUpdate, recheckTime, reconnectLogLevel, reconnectRecheckTime, stopRequested, update0Items, update0pending, updateConfiguration, updateQueue, wlm, worklist, worklistLock| Constructor and Description |
|---|
WorklistHandler(WorklistManager wlm,
WorklistUpdateConfiguration updateConfiguration,
long recheckTime,
int createWorklistSilentCount,
long createWorklistRetryDelay,
boolean resumeOnly,
int addSourceRetries,
long addSourceRetryDelay,
AbstractEventManager eventManager,
Registry registry,
long reconnectRecheckTime,
java.util.logging.Level reconnectLogLevel)
Creates a new instance of the worklist handler that creates event sources
for worklist items with activities that wait for an event.
|
| Modifier and Type | Method and Description |
|---|---|
protected Triple<java.lang.Throwable,java.lang.Integer,java.lang.Long> |
addEventSource(WorklistItem item)
Adds an event source for the designated worklist item, that is the session
context of the activity is retrieved by starting or resuming the item, an
event source is created by the appropriate event manager and the event
handler is initialised and added.
|
protected de.aristaflow.adept2.core.automaticclient.ItemHandler |
createItemHandler(ClientWorklistItem worklistItem)
Creates an item handler for adding an event source for the designated
worklist item.
|
protected SessionToken |
createSession() |
protected boolean |
itemProcessable(ClientWorklistItem item)
This implementation also checks for whether the ECD name starts with
de.aristaflow.events. |
protected void |
prepareCompleteUpdate() |
protected void |
processCompleteUpdate(ClientWorklistItem item,
boolean resumeOnly) |
protected void |
processItemUpdate(WorklistItemUpdate<ClientWorklistItem> itemUpdate,
boolean resumeOnly) |
protected void |
removeEventSource(WorklistItem item)
Removes the event source for the designated worklist item from the running
items.
|
checkAndReconnect, connectAndHandleWL, getWorklistItem, processCompleteUpdate, processUpdate, run, stopWlHandling, terminate, worklistUpdatedactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprotected final AbstractEventManager eventManager
protected final Registry registry
protected int addSourceRetries
protected long addSourceRetryDelay
protected final java.util.Collection<de.aristaflow.adept2.core.automaticclient.ItemHandler> pendingSelected
protected final java.util.Map<EBPInstanceReference,Triple<java.lang.String,java.lang.String,java.lang.String>> runningItems
public WorklistHandler(WorklistManager wlm, WorklistUpdateConfiguration updateConfiguration, long recheckTime, int createWorklistSilentCount, long createWorklistRetryDelay, boolean resumeOnly, int addSourceRetries, long addSourceRetryDelay, AbstractEventManager eventManager, Registry registry, long reconnectRecheckTime, java.util.logging.Level reconnectLogLevel)
wlm - The worklist manager for registering and deregistering for
pushed worklist updates.updateConfiguration - The configuration for the worklist updates
processed by this worklist handler.recheckTime - The time interval in milliseconds which to regularly
check whether the worklist manager is still available or available
again.createWorklistSilentCount - The number of retries for creating
(retrieving) a client worklist before logging the exception as
critical.createWorklistRetryDelay - The time in milliseconds to wait before
retrying to create (retrieve) a client worklist.eventManager - The event manager for registering and unregistering
events and for providing session tokens.resumeOnly - Flag to indicate whether to resume items and not to start
new ones. This drains the current work of this worklist handler.addSourceRetries - The maximum number of tries to add the event source
before the corresponding activity will be failed.addSourceRetryDelay - The time in milliseconds before retrying to add
the event source.registry - The registry for retrieving the appropriate data source.reconnectRecheckTime - The time interval in milliseconds which to
reconnect to the worklist manager if no push update was received
yet.reconnectLogLevel - The log level that will be used to log that no
push update was received yet.protected boolean itemProcessable(ClientWorklistItem item)
de.aristaflow.events.itemProcessable in class de.aristaflow.adept2.core.automaticclient.AbstractWorklistHandlerprotected SessionToken createSession()
createSession in class de.aristaflow.adept2.core.automaticclient.AbstractWorklistHandlerprotected void processCompleteUpdate(ClientWorklistItem item, boolean resumeOnly)
processCompleteUpdate in class de.aristaflow.adept2.core.automaticclient.AbstractWorklistHandlerprotected void prepareCompleteUpdate()
prepareCompleteUpdate in class de.aristaflow.adept2.core.automaticclient.AbstractWorklistHandlerprotected void processItemUpdate(WorklistItemUpdate<ClientWorklistItem> itemUpdate, boolean resumeOnly)
processItemUpdate in class de.aristaflow.adept2.core.automaticclient.AbstractWorklistHandlerprotected de.aristaflow.adept2.core.automaticclient.ItemHandler createItemHandler(ClientWorklistItem worklistItem)
worklistItem - The worklist item for which to add an event source.protected Triple<java.lang.Throwable,java.lang.Integer,java.lang.Long> addEventSource(WorklistItem item)
null. In case of an exception, the exception is
logged and returned. Additionally, if the activity configuration provides
values for retrying to add the event source, these values will also be
returned.item - The worklist item for which to add an event source.null if they are not provided by the activity
configuration. null
will be returned.protected void removeEventSource(WorklistItem item)
item - The item of which the corresponding event source is to be
removed.