Class EventSourceAdder

  • All Implemented Interfaces:
    Runnable

    @Deprecated
    public class EventSourceAdder
    extends de.aristaflow.adept2.core.automaticclient.ItemHandler
    Deprecated.
    Use AddSourceRunnable instead.
    An 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.
    The number of retries as well as the time between retries can be configured per activity. If an activity configuration does not provide a corresponding value, the defaults configured for the event manager will be used. If all retries have been unsuccessful, the activity will be failed.

    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.

    • Field Detail

      • EVENT_SOURCE_ADDING_FAILED_STATE

        public static final String EVENT_SOURCE_ADDING_FAILED_STATE
        Deprecated.
        State for adding the event source failed finally.
        See Also:
        Constant Field Values
      • EVENT_SOURCE_ADDING_FAILED_CODE

        public static final long EVENT_SOURCE_ADDING_FAILED_CODE
        Deprecated.
        Code for adding the event source failed finally.
        See Also:
        Constant Field Values
      • handler

        protected final WorklistHandler handler
        Deprecated.
        The worklist handler for adding the event source.
      • pendingItems

        protected final Collection<de.aristaflow.adept2.core.automaticclient.ItemHandler> pendingItems
        Deprecated.
        A collection tracking all items for which currently an event source is about to be added. This worklist items are usually selected.
        This collection allows to ItemHandler.invalidate() worklist items while they are pending for handling.
      • pollService

        protected final ScheduledExecutorService pollService
        Deprecated.
        The poll service for rescheduling event source adders in case adding the event source fails (again).
      • eventManager

        protected final ActivityEventManager eventManager
        Deprecated.
        The event manager which to use for starting and failing the activity in case adding the event source fails finally.
      • currentRun

        protected int currentRun
        Deprecated.
        The number of times the event source has been tried to add. This is incremented before a try to add the event source.
      • retries

        protected int retries
        Deprecated.
        The maximum number of tries to add the event source before the corresponding activity will be failed.
        This will be set to the value configured for the event manager until the activity configuration is available. Afterwards it will use the value from the activity configuration if this provides a value.
      • retryDelay

        protected long retryDelay
        Deprecated.
        The time in milliseconds before retrying to add the event source.
        This will be set to the value configured for the event manager until the activity configuration is available. Afterwards it will use the value from the activity configuration if this provides a value.
    • Constructor Detail

      • EventSourceAdder

        public EventSourceAdder​(ClientWorklistItem item,
                                int retries,
                                long retryDelay,
                                WorklistHandler handler,
                                Collection<de.aristaflow.adept2.core.automaticclient.ItemHandler> pendingSelected,
                                ScheduledExecutorService pollService,
                                ActivityEventManager eventManager,
                                LogService logService)
        Deprecated.
        Creates a new worklist item handler for adding event sources for specific worklist items.
        Parameters:
        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.
    • Method Detail

      • run

        public void run()
        Deprecated.