public interface ActiveEvent<T extends Releasable<T,D>,D extends ActiveEventDispatcher<D,T>> extends Releasable<T,D>
This is the interface for defining the active event system. Classes
implementing ActiveEvent
are used to connect events
that take place outside the Java virtual machine to RTSJ activities.
When an event takes place outside the Java virtual machine, some
event-specific code within the Java virtual machine executes. That code
notifies the ActiveEvent
infrastructure of this event by
calling a trigger
method in the event.
An instance of this class holds a reference to its dispatcher. When
isActive()
is true
, the dispatcher must also
hold a reference to the instance. For this reason, whenever an active
event instance is active, it is also a execution context, so that this
reference can be safely held during this time. Only the active event
instance must be assignable to its dispatcher instance under the memory
assignment rules, but not visa versa.
Modifier and Type | Method and Description |
---|---|
void |
disable()
Changes the state of the event so that associated handlers are
skipped on fire.
|
void |
enable()
Changes the state of the event so that associated handlers are
released on fire.
|
boolean |
isActive()
Determines the activation state of this event, i.e., it has been started
but not yet stopped again.
|
boolean |
isRunning()
Determines the running state of this event, i.e., it is both active and
enabled.
|
void |
start()
Starts this active event.
|
void |
start(boolean disabled)
Starts this active event.
|
boolean |
stop()
Stops this active event.
|
getDispatcher
boolean isActive()
true
when active, false
otherwise.boolean isRunning()
true
when active and enabled, false
otherwise.void start() throws StaticIllegalStateException
StaticIllegalStateException
- when this event
has already been started.void start(boolean disabled) throws StaticIllegalStateException
StaticIllegalStateException
- when this event
has already been started.disabled
- True for starting in a disabled state.boolean stop() throws StaticIllegalStateException
StaticIllegalStateException
- when this event
is not running.void enable()
void disable()
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2019 aicas GmbH. All Rights Reserved.