Class ScheduledProcessStartEventImpl
java.lang.Object
de.aristaflow.adept2.core.eventmanager.common.AbstractEvent
de.aristaflow.adept2.core.eventmanager.timeevents.ScheduledProcessStartEventImpl
- All Implemented Interfaces:
ScheduledProcessStartEvent,Event,TimeScheduleEvent
public class ScheduledProcessStartEventImpl
extends AbstractEvent
implements ScheduledProcessStartEvent
An event of a scheduled process start for one of its due times. A handler may set the outcome on
another thread than the one of the source reading it, so the outcome is accessed under the lock
of the event.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final InstantThe due time for which this event has been raised.protected InstantThe time of the last failed attempt of the trigger of this event,nullunless every attempt has failed.protected final UUIDThe ID of the instance which the last successful trigger of the start has started,nullif no trigger has started one.protected final ScheduledProcessStartThe scheduled process start which has raised this event.protected booleanWhether the trigger of this event has skipped its due time.protected UUIDThe ID of the instance which the trigger of this event has started,nullunless this is its outcome.Fields inherited from class de.aristaflow.adept2.core.eventmanager.common.AbstractEvent
creationTime, eventType, id, ID_COUNT, managerURI, sourceID, sourceType -
Constructor Summary
ConstructorsConstructorDescriptionScheduledProcessStartEventImpl(URI[] managerURI, String eventType, String sourceType, String sourceID, ScheduledProcessStart processStart, Instant dueTime, UUID lastInstance) Creates a new event of the designated scheduled process start for the designated due time. -
Method Summary
Modifier and TypeMethodDescriptionGets the due time for which this event has been raised.Gets the time of the last failed attempt of the trigger of this event.Gets the ID of the instance which the last successful trigger of the start has started.Gets the time schedule of which a due time has raised this event.Gets the scheduled process start which has raised this event.Gets the ID of the instance which the trigger of this event has started.booleanGets whether the trigger of this event has skipped its due time.voidSets the outcome of the trigger of this event: every attempt to start an instance has failed, the last one at the designated time.voidSets the outcome of the trigger of this event: it has skipped its due time without attempting to start an instance.voidsetStarted(UUID instanceID) Sets the outcome of the trigger of this event: it has started the instance of the designated ID.Methods inherited from class de.aristaflow.adept2.core.eventmanager.common.AbstractEvent
getCreationTime, getEventManager, getEventType, getID, getSourceID, getSourceTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.aristaflow.adept2.model.events.Event
getCreationTime, getEventManager, getEventType, getID, getSourceID, getSourceType
-
Field Details
-
processStart
The scheduled process start which has raised this event. -
dueTime
The due time for which this event has been raised. -
lastInstance
The ID of the instance which the last successful trigger of the start has started,nullif no trigger has started one. -
startedInstance
The ID of the instance which the trigger of this event has started,nullunless this is its outcome. -
lastFailedAttempt
The time of the last failed attempt of the trigger of this event,nullunless every attempt has failed. -
skipped
protected boolean skippedWhether the trigger of this event has skipped its due time.
-
-
Constructor Details
-
ScheduledProcessStartEventImpl
public ScheduledProcessStartEventImpl(URI[] managerURI, String eventType, String sourceType, String sourceID, ScheduledProcessStart processStart, Instant dueTime, UUID lastInstance) Creates a new event of the designated scheduled process start for the designated due time.- Parameters:
managerURI- The URIs of the service (event manager) creating the event.eventType- The type of the event.sourceType- The type of the source of this event.sourceID- The ID of the source of this event.processStart- The scheduled process start which raises the event. This must not benull.dueTime- The due time for which the event is raised. This must not benull.lastInstance- The ID of the instance which the last successful trigger of the start has started ornullif no trigger has started one.
-
-
Method Details
-
getDueTime
Description copied from interface:TimeScheduleEventGets the due time for which this event has been raised. It lies before the creation of the event if the due time is handled late, for instance after it has passed while no source ran.- Specified by:
getDueTimein interfaceTimeScheduleEvent- Returns:
- The due time for which this event has been raised. This will never be
null.
-
getSchedule
Description copied from interface:TimeScheduleEventGets the time schedule of which a due time has raised this event.- Specified by:
getSchedulein interfaceTimeScheduleEvent- Returns:
- The time schedule of which a due time has raised this event. This will never be
null.
-
getScheduledProcessStart
Description copied from interface:ScheduledProcessStartEventGets the scheduled process start which has raised this event.- Specified by:
getScheduledProcessStartin interfaceScheduledProcessStartEvent- Returns:
- The scheduled process start which has raised this event. This will never be
null.
-
getLastInstance
Description copied from interface:ScheduledProcessStartEventGets the ID of the instance which the last successful trigger of the start has started. A start with a fixed rate which allows no overlapping instances skips its due time while this instance runs.- Specified by:
getLastInstancein interfaceScheduledProcessStartEvent- Returns:
- The ID of the instance which the last successful trigger of the start has started or
nullif no trigger has started one.
-
setStarted
Description copied from interface:ScheduledProcessStartEventSets the outcome of the trigger of this event: it has started the instance of the designated ID. This replaces an outcome set before.- Specified by:
setStartedin interfaceScheduledProcessStartEvent- Parameters:
instanceID- The ID of the started instance. This must not benull.
-
setFailed
Description copied from interface:ScheduledProcessStartEventSets the outcome of the trigger of this event: every attempt to start an instance has failed, the last one at the designated time. This replaces an outcome set before.- Specified by:
setFailedin interfaceScheduledProcessStartEvent- Parameters:
lastAttempt- The time of the last failed attempt. This must not benull.
-
setSkipped
public void setSkipped()Description copied from interface:ScheduledProcessStartEventSets the outcome of the trigger of this event: it has skipped its due time without attempting to start an instance. This replaces an outcome set before.- Specified by:
setSkippedin interfaceScheduledProcessStartEvent
-
getStartedInstance
Description copied from interface:ScheduledProcessStartEventGets the ID of the instance which the trigger of this event has started.- Specified by:
getStartedInstancein interfaceScheduledProcessStartEvent- Returns:
- The ID of the instance which the trigger of this event has started or
nullif its outcome is another one or it has none.
-
getLastFailedAttempt
Description copied from interface:ScheduledProcessStartEventGets the time of the last failed attempt of the trigger of this event.- Specified by:
getLastFailedAttemptin interfaceScheduledProcessStartEvent- Returns:
- The time of the last failed attempt of the trigger of this event or
nullif its outcome is another one or it has none.
-
isSkipped
public boolean isSkipped()Description copied from interface:ScheduledProcessStartEventGets whether the trigger of this event has skipped its due time.- Specified by:
isSkippedin interfaceScheduledProcessStartEvent- Returns:
- Whether the trigger of this event has skipped its due time.
-