public class BoundAsyncLongEventHandler extends AsyncLongEventHandler implements BoundSchedulable
AsyncLongEventHandler that is permanently bound to a dedicated
RealtimeThread. Bound asynchronous long event handlers are
for use in situations where the added timeliness is worth the overhead of
dedicating an individual realtime thread to the handler. Individual
server realtime threads can only be dedicated to a single bound event
handler.
An instance of this class behaves exactly as an instance of
AsyncLongEventHandler, with the only difference being that this
instance will have its own instance of RealtimeThread or
NoHeapRealtimeThread associated to it.
An instance of this class should be used in preference
to a normal AsyncLongEventHandler when the added timeliness of
not sharing a thread with other handlers is required. A handler that
may block should be of this class since it might otherwise prevent
the execution of other AsyncLongEventHandlers that may require the
same shared thread.
As long as all handlers with equal priority parameters do not block during their execution, there is no need to use BoundAsyncLongEventHandler for this since several threads of the same priority might block one another.
| Constructor and Description |
|---|
BoundAsyncLongEventHandler()
Creates an instance of
BoundAsyncLongEventHandler using
default values. |
BoundAsyncLongEventHandler(java.util.function.LongConsumer logic)
Creates an instance of
BoundAsyncLongEventHandler. |
BoundAsyncLongEventHandler(SchedulingParameters scheduling,
ReleaseParameters<?> release)
Creates an instance of
BoundAsyncLongEventHandler. |
BoundAsyncLongEventHandler(SchedulingParameters scheduling,
ReleaseParameters<?> release,
java.util.function.LongConsumer logic)
Creates an instance of
BoundAsyncLongEventHandler. |
BoundAsyncLongEventHandler(SchedulingParameters scheduling,
ReleaseParameters<?> release,
MemoryParameters memory,
MemoryArea area,
RealtimeThreadGroup group,
ConfigurationParameters config,
java.util.function.LongConsumer logic)
Creates an instance of
BoundAsyncEventHandler (BAEH) with the
specified parameters. |
| Modifier and Type | Method and Description |
|---|---|
ConfigurationParameters |
getConfigurationParameters() |
handleAsyncEvent, peekPendingaddIfFeasible, addToFeasibility, finalize, getAndClearPendingFireCount, getAndDecrementPendingFireCount, getDispatcher, getMemoryArea, getMemoryParameters, getPendingFireCount, getProcessingGroupParameters, getReleaseParameters, getScheduler, getSchedulingParameters, isDaemon, mayUseHeap, removeFromFeasibility, run, setDaemon, setIfFeasible, setIfFeasible, setIfFeasible, setIfFeasible, setIfFeasible, setMemoryParameters, setMemoryParametersIfFeasible, setProcessingGroupParameters, setProcessingGroupParametersIfFeasible, setReleaseParameters, setReleaseParametersIfFeasible, setScheduler, setScheduler, setSchedulingParameters, setSchedulingParametersIfFeasible, subsumesclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddIfFeasible, addToFeasibility, getMemoryParameters, getProcessingGroupParameters, getReleaseParameters, getScheduler, getSchedulingParameters, isDaemon, mayUseHeap, removeFromFeasibility, setDaemon, setIfFeasible, setIfFeasible, setIfFeasible, setIfFeasible, setIfFeasible, setMemoryParameters, setMemoryParametersIfFeasible, setProcessingGroupParameters, setProcessingGroupParametersIfFeasible, setReleaseParameters, setReleaseParametersIfFeasible, setScheduler, setScheduler, setSchedulingParameters, setSchedulingParametersIfFeasible, subsumesgetDispatcherpublic BoundAsyncLongEventHandler(SchedulingParameters scheduling, ReleaseParameters<?> release, MemoryParameters memory, MemoryArea area, RealtimeThreadGroup group, ConfigurationParameters config, java.util.function.LongConsumer logic)
BoundAsyncEventHandler (BAEH) with the
specified parameters.scheduling - A SchedulingParameters object which will
be associated with the constructed instance. When
null, and the creator is not an instance of
Schedulable, a SchedulingParameters object is
created which has the default SchedulingParameters
for the scheduler associated with the current thread. When
null, and the creator is an instance of
Schedulable, the SchedulingParameters are
inherited from the current schedulable (a new
SchedulingParameters object is cloned).
The Affinity of the newly-created handler will be
set as follow:
AsyncBaseEventHandler.setSchedulingParameters(SchedulingParameters),
the default affinity assigned to this Schedulable will not appear
in the SchedulingParameters returned by
AsyncBaseEventHandler.getSchedulingParameters().release - A ReleaseParameters object which will be
associated with the constructed instance. When
null, this will have default
ReleaseParameters for the BAEH's scheduler.memory - A MemoryParameters object which will be
associated with the constructed instance. When
null, this will have no
MemoryParameters and the handler can access the heap.area - The MemoryArea for this. When
null, the memory area will be that of the
current thread/schedulable.group - A RealtimeThreadGroup object which will
be associated with the constructed instance. When
null, this will be
associated with the creating thread's realtime thread group.config - The ConfigurationParameters associated with
this, and possibly other instances of Schedulable.
When config is null, this
BoundAsyncEventHandler will reserve no space for
preallocated exceptions and implementation-specific values will
be set to their implementation-defined defaults.logic - The LongConsumer object whose accept()
method is executed by
AsyncLongEventHandler.handleAsyncEvent(long).
When null, the default handleAsyncEvent(long)
method invokes nothing.ProcessorAffinityException - when the Affinity in SchedulingParameters
is invalid or not a subset of the groups this is
associated to.StaticIllegalArgumentException - when config is of type
javax.realtime.memory.ScopedConfigurationParameters
and logic, any parameter object, or this is
in heap memory.IllegalAssignmentError - when the new AsyncEventHandler
instance cannot hold a reference to any value assigned to
one of the scheduling, release, memory,
or group parameters, or when those parameters
cannot hold a reference to the new AsyncEventHandler.
Also when the new AsyncEventHandler instance cannot
hold a reference to values assigned to area or
logic.public BoundAsyncLongEventHandler(SchedulingParameters scheduling, ReleaseParameters<?> release, java.util.function.LongConsumer logic)
BoundAsyncLongEventHandler.
This constructor is equivalent to
BoundAsyncLongEventHandler(scheduling, release, null, null, null, null, logic)public BoundAsyncLongEventHandler(SchedulingParameters scheduling, ReleaseParameters<?> release)
BoundAsyncLongEventHandler.
Calling this constructor is equivalent to calling
BoundAsyncLongEventHandler(scheduling, release, null, null, null, null, null)public BoundAsyncLongEventHandler(java.util.function.LongConsumer logic)
BoundAsyncLongEventHandler.
Calling this constructor is equivalent to calling
BoundAsyncLongEventHandler(null, null, null, null, null, null, logic)public BoundAsyncLongEventHandler()
BoundAsyncLongEventHandler using
default values. Calling this constructor is equivalent to calling
BoundAsyncLongEventHandler(null, null, null, null, null, null, null)public ConfigurationParameters getConfigurationParameters()
getConfigurationParameters in interface BoundSchedulableaicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2021 aicas GmbH. All Rights Reserved.