P - is the type of Object received.public class AsyncObjectEventHandler<P> extends AsyncBaseEventHandler
AsyncBaseEventHandler that carries an
Object value as payload.| Modifier and Type | Method and Description |
|---|---|
void |
handleAsyncEvent(P payload)
This method holds the logic which is to be executed when any
AsyncEvent with which this handler is associated is fired. |
P |
peekPending()
Determines the next value queued for handling.
|
void |
release(P payload)
Release this handler now.
|
addToFeasibility, getAndClearPendingFireCount, getAndDecrementPendingFireCount, getConfigurationParameters, getCurrentReleaseTime, getCurrentReleaseTime, getDispatcher, getMemoryArea, getMemoryParameters, getPendingFireCount, getProcessingGroupParameters, getQueueLength, getReleaseParameters, getReleaseRunner, getScheduler, getSchedulingParameters, isDaemon, mayUseHeap, removeFromFeasibility, run, setDaemon, setMemoryParameters, setProcessingGroupParameters, setReleaseParameters, setScheduler, setScheduler, setSchedulingParameters, setSchedulingParametersIfFeasible, subsumespublic AsyncObjectEventHandler(SchedulingParameters scheduling, ReleaseParameters<?> release, MemoryParameters memory, MemoryArea area, ConfigurationParameters config, ReleaseRunner runner, Consumer<P> logic) throws StaticIllegalArgumentException
Object
payload with each fire.StaticIllegalArgumentException - when the event queue
overflow policy is QueueOverflowPolicy.DISABLE.scheduling - Parameter for scheduling the new handler
(and possibly other instances of Schedulable). When
scheduling is null and the
creator is an instance of Schedulable,
SchedulingParameters is a clone of the creator's value
created in the same memory area as this. When
scheduling is null and the creator is
a task that is not an instance of Schedulable, the
contents and type of the new SchedulingParameters
object are governed by the associated scheduler.release - Parameter for scheduling the new handler
(and possibly other instances of Schedulable). When
release is null the new
AsyncEventHandler will use a clone of the
default ReleaseParameters for the associated
scheduler created in the memory area that contains the
AsyncEventHandler object.memory - Parameter for scheduling the new handler
(and possibly other instances of Schedulable). When
memory is null, the new
AsyncEventHandler receives null value
for its memory parameters, and the amount or rate of memory
allocation for the new handler is unrestricted.area - The initial memory area of this handler.config - The configuration parameters for this handler.runner - Logic to be executed by handleAsyncEvent(P)logic - The logic to run for each fire. When logic
is null, the handleAsyncEvent
method in the new object will serve as its logic.public AsyncObjectEventHandler(SchedulingParameters scheduling, ReleaseParameters<?> release, Consumer<P> logic) throws StaticIllegalArgumentException
AsyncObjectEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
ConfigurationParameters,
ReleaseRunner,
Consumer)
with arguments (scheduling, release, null, null, null, null, logic).StaticIllegalArgumentExceptionpublic AsyncObjectEventHandler(SchedulingParameters scheduling, ReleaseParameters<?> release) throws StaticIllegalArgumentException
AsyncObjectEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
ConfigurationParameters,
ReleaseRunner,
Consumer)
with arguments (scheduling, release, null, null, null, null, null)StaticIllegalArgumentExceptionpublic AsyncObjectEventHandler(Consumer<P> logic)
AsyncObjectEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
ConfigurationParameters,
ReleaseRunner,
Consumer)
with arguments (null, null, null, null, null, null, logic).public AsyncObjectEventHandler()
AsyncObjectEventHandler (AOEH) with default
values for all parameters.public void handleAsyncEvent(P payload)
AsyncEvent with which this handler is associated is fired.
This method will be invoked repeatedly while fireCount_ is
greater than zero.
The default implementation of this method either invokes the
run method of the logic passed to the
constructor of this handler, when it is an instance of
Runnable or nothing, when logic is null.
This AOEH is a source of reference for its initial memory area while this AOEH is released.
All throwables from (or propagated through)
handleAsyncEvent(P) are caught, a stack trace is printed
and execution continues as if handleAsyncEvent(P) had
returned normally.
payload - The data associated with the release being handled.public P peekPending() throws StaticIllegalStateException
StaticIllegalStateException - when the fire count is zero.handleAsyncEvent(P)}.public void release(P payload) throws MITViolationException, ArrivalTimeQueueOverflowException
MITViolationException - iff the minimum interarrival time
was not respected and the MIT-violation behavior is set to EXCEPT.ArrivalTimeQueueOverflowException - if an overflow in the
arrival time queue occurred and the arrival time queue overflow
behavior is EXCEPT.payload - The data associated with the release.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2024 aicas GmbH. All Rights Reserved.