public final class RealtimeSignalDispatcher extends ActiveEventDispatcher<RealtimeSignalDispatcher,RealtimeSignal>
RealtimeSignal
instances,
each when its respective signal is triggered. An application can provide
its own dispatcher, providing the priority for
the internal dispatching thread. This dispatching thread calls
the AsyncLongEvent.fire(long)
method on the instance of
RealtimeSignal
associated with the signal each time its
signal is triggered.Constructor and Description |
---|
RealtimeSignalDispatcher(SchedulingParameters schedule)
Creates a new dispatcher, whose dispatching thread runs with the given
SchedulingParameters . |
RealtimeSignalDispatcher(SchedulingParameters schedule,
RealtimeThreadGroup group)
Creates a new dispatcher, whose dispatching thread runs with the given
SchedulingParameters . |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(RealtimeSignal signal)
Activate an active event registered with this
dispatcher.
|
protected void |
deactivate(RealtimeSignal signal)
Deactivate an active event registered with this dispatcher.
|
protected void |
deregister(RealtimeSignal signal)
Deregisters an active event from this dispatcher, breaking its
association with this dispatcher.
|
void |
destroy()
Releases all reasources thereby making the dispatcher unusable.
|
static RealtimeSignalDispatcher |
getDefaultDispatcher() |
boolean |
isRegistered(RealtimeSignal signal)
Test wether or not a given event is registered with this
dispatcher.
|
protected void |
register(RealtimeSignal signal)
Registers an active event with this dispatcher.
|
static void |
setDefaultDispatcher(RealtimeSignalDispatcher dispatcher)
Sets the system default realtime signal dispatcher.
|
void |
trigger(int signal,
long payload) |
getRealtimeThreadGroup, getScheduler, getSchedulingParameters, getThread, setScheduler, setScheduler, setSchedulingParameters
public RealtimeSignalDispatcher(SchedulingParameters schedule, RealtimeThreadGroup group)
SchedulingParameters
.StaticIllegalStateException
- when the intersection of affinity
in schedule
and the affinity of group
does not
correspond to a valid affinity.schedule
- Provides scheduling information to the new object.
When affinity is specified, this affinity has to be valid and
to be a subset of the affinity of the realtime thread group
specified in the group
parameter. When the affinity
is not specified in schedule
or when
schedule
is null, the affinity will be assumed to be
the affinity of the creating task.group
- The RealtimeThreadGroup
of the thread of this
dispatcher. When null
, the closest instance of
RealtimeThreadGroup
in the hierarchy of thread
groups containg the calling task is used.public RealtimeSignalDispatcher(SchedulingParameters schedule)
SchedulingParameters
.StaticIllegalStateException
- when the intersection of affinity
in schedule
and the affinity of the current thread group
does not correspond to a valid affinity.schedule
- Parameters for scheduling this dispatcher.public static RealtimeSignalDispatcher getDefaultDispatcher()
public static void setDefaultDispatcher(RealtimeSignalDispatcher dispatcher)
dispatcher
- The instance to be used when no dispatcher is
provided. When null
, the realtime signal dispatcher
is set to the original system default.public boolean isRegistered(RealtimeSignal signal)
isRegistered
in class ActiveEventDispatcher<RealtimeSignalDispatcher,RealtimeSignal>
signal
- The event to testtrue
when event
is registered with this
dispatcher.protected void register(RealtimeSignal signal) throws RegistrationException, StaticIllegalStateException
register
in class ActiveEventDispatcher<RealtimeSignalDispatcher,RealtimeSignal>
RegistrationException
- when event
is already
registered.StaticIllegalStateException
- when this object has been destroyed.signal
- The event to registerprotected void activate(RealtimeSignal signal) throws StaticIllegalArgumentException
activate
in class ActiveEventDispatcher<RealtimeSignalDispatcher,RealtimeSignal>
StaticIllegalArgumentException
signal
- The event to registerprotected void deregister(RealtimeSignal signal) throws DeregistrationException, StaticIllegalStateException
deregister
in class ActiveEventDispatcher<RealtimeSignalDispatcher,RealtimeSignal>
StaticIllegalStateException
- when this object has been
destroyedDeregistrationException
signal
- The event to deregisterprotected void deactivate(RealtimeSignal signal) throws StaticIllegalArgumentException
deactivate
in class ActiveEventDispatcher<RealtimeSignalDispatcher,RealtimeSignal>
StaticIllegalArgumentException
- when event
is not
stopped or is null
.signal
- The event to deregisterpublic void trigger(int signal, long payload)
public void destroy() throws StaticIllegalStateException
destroy
in class ActiveEventDispatcher<RealtimeSignalDispatcher,RealtimeSignal>
StaticIllegalStateException
- when called on
a dispatcher that has one or more registered
RealtimeSignal
objects.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2024 aicas GmbH. All Rights Reserved.