public class AsyncLongEventHandler extends AsyncBaseEventHandler
AsyncBaseEventHandler
that carries a
long
value as payload.Modifier and Type | Method and Description |
---|---|
void |
handleAsyncEvent(long payload)
This method holds the logic which is to be executed when any
AsyncEvent with which this handler is associated is fired. |
long |
peekPending()
Determines the next value queued for handling.
|
void |
release(long 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, subsumes
public AsyncLongEventHandler(SchedulingParameters scheduling, ReleaseParameters<?> release, MemoryParameters memory, MemoryArea area, ConfigurationParameters config, ReleaseRunner runner, LongConsumer logic) throws StaticIllegalArgumentException
Long
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(long)
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 AsyncLongEventHandler(SchedulingParameters scheduling, ReleaseParameters<?> release, LongConsumer logic) throws StaticIllegalArgumentException
AsyncLongEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
ConfigurationParameters,
ReleaseRunner,
LongConsumer)
with arguments (scheduling, release, null, null, null, null, logic)
.StaticIllegalArgumentException
public AsyncLongEventHandler(SchedulingParameters scheduling, ReleaseParameters<?> release) throws StaticIllegalArgumentException
AsyncLongEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
ConfigurationParameters,
ReleaseRunner,
LongConsumer)
with arguments (scheduling, release, null, null, null, null, null)
StaticIllegalArgumentException
public AsyncLongEventHandler(LongConsumer logic)
AsyncLongEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
ConfigurationParameters,
ReleaseRunner,
LongConsumer)
with arguments (null, null, null, null, null, null, logic)
.public AsyncLongEventHandler()
AsyncLongEventHandler
(ALEH) with default
values for all parameters.public void handleAsyncEvent(long 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 ALEH is a source of reference for its initial memory area while this ALEH is released.
All throwables from (or propagated through)
handleAsyncEvent
are caught, a stack trace is printed
and execution continues as if handleAsyncEvent
had
returned normally.
payload
- It is the long value associated with a fire.public long peekPending() throws StaticIllegalStateException
StaticIllegalStateException
- when the fire count is zero.handleAsyncEvent(long)
.public void release(long 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.