public class AsyncLongEventHandler extends AsyncBaseEventHandler
AsyncBaseEventHandler
that carries a
long
value as payload.Constructor and Description |
---|
AsyncLongEventHandler()
Creates an instance of
AsyncLongEventHandler (ALEH) with default
values for all parameters. |
AsyncLongEventHandler(LongConsumer logic)
Calling this constructor is equivalent to calling
AsyncLongEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
ReleaseRunner,
LongConsumer)
with arguments (null, null, null, null, null, null, logic) . |
AsyncLongEventHandler(SchedulingParameters scheduling,
ReleaseParameters release)
Calling this constructor is equivalent to calling
AsyncLongEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
ReleaseRunner,
LongConsumer)
with arguments (scheduling, release, null, null, null, null) |
AsyncLongEventHandler(SchedulingParameters scheduling,
ReleaseParameters release,
LongConsumer logic)
Calling this constructor is equivalent to calling
AsyncLongEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
ReleaseRunner,
LongConsumer)
with arguments (scheduling, release, null, null, null, logic) . |
AsyncLongEventHandler(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
MemoryArea area,
ReleaseRunner runner,
LongConsumer logic)
Creates an asynchronous event handler that receives a
Long
payload with each fire. |
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 |
run()
When an object implementing interface
Runnable is used
to create a thread, starting the thread causes the object's
run method to be called in that separately executing
thread. |
addIfFeasible, addToFeasibility, finalize, getAndClearPendingFireCount, getAndDecrementPendingFireCount, getAndIncrementPendingFireCount, getDispatcher, getMemoryArea, getMemoryParameters, getPendingFireCount, getProcessingGroupParameters, getReleaseParameters, getScheduler, getSchedulingParameters, isDaemon, removeFromFeasibility, setDaemon, setIfFeasible, setIfFeasible, setIfFeasible, setIfFeasible, setIfFeasible, setMemoryParameters, setMemoryParametersIfFeasible, setProcessingGroupParameters, setProcessingGroupParametersIfFeasible, setReleaseParameters, setReleaseParametersIfFeasible, setScheduler, setScheduler, setSchedulingParameters, setSchedulingParametersIfFeasible
public AsyncLongEventHandler(SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, MemoryArea area, 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.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,
ReleaseRunner,
LongConsumer)
with arguments (scheduling, release, null, null, null, logic)
.StaticIllegalArgumentException
public AsyncLongEventHandler(SchedulingParameters scheduling, ReleaseParameters release) throws StaticIllegalArgumentException
AsyncLongEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
ReleaseRunner,
LongConsumer)
with arguments (scheduling, release, null, null, null, null)
StaticIllegalArgumentException
public AsyncLongEventHandler(LongConsumer logic)
AsyncLongEventHandler(SchedulingParameters,
ReleaseParameters,
MemoryParameters,
MemoryArea,
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.
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 final void run()
Runnable
Runnable
is used
to create a thread, starting the thread causes the object's
run
method to be called in that separately executing
thread.
The general contract of the method run
is that it may
take any action whatsoever.
Thread.run()
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2019 aicas GmbH. All Rights Reserved.