public abstract class AsyncBaseEvent extends Object
AsyncEvent
with
AsyncLongEvent
.
Note that when this class is collected, all its handlers are
automatically removed as if setHandler(javax.realtime.AsyncBaseEventHandler)
was called with a
null
parameter.
Modifier and Type | Method and Description |
---|---|
void |
addHandler(AsyncBaseEventHandler handler)
Add a handler to the set of handlers associated with
this event.
|
ReleaseParameters<?> |
createReleaseParameters()
Create a ReleaseParameters object appropriate to the release
characteristics of this event.
|
void |
disable()
Change the state of the event so that the associated handlers
are skipped on fire.
|
void |
enable()
Change the state of the event so that associated handlers
are released on fire.
|
boolean |
handledBy(AsyncBaseEventHandler handler)
Test to see if the handler given as the parameter is associated
with this.
|
boolean |
hasHandlers()
Determine whether or not this event has any handlers.
|
boolean |
isRunning()
Determine the firing state (releasing or skipping) of this
event, i.e, whether it is enabled or disabled
|
void |
removeHandler(AsyncBaseEventHandler handler)
Remove a handler from the set associated with this event.
|
void |
setHandler(AsyncBaseEventHandler handler)
Associate a new handler with this event and remove all
existing handlers.
|
public void addHandler(AsyncBaseEventHandler handler)
StaticIllegalArgumentException
- when
handler is null or the handler has PeriodicParametersIllegalAssignmentError
- when this AsyncBaseEvent
cannot hold a reference to this handlerStaticIllegalStateException
- when the configured
scheduler and SchedulingParameters for handler are not
compatible with one anotherScopedCycleException
- when handler has an explicit
initial scoped memory area that has already been entered from
a memory area other than the area where handler was allocatedhandler
- The new handler to add to the list of
handlers already associated with this.
When handler is already associated with
the event, the call has no effectpublic void setHandler(AsyncBaseEventHandler handler)
StaticIllegalArgumentException
- when handler
has PeriodicParameters. Only the subclass PeriodicTimer
is allowed to have handlers with PeriodicParametersIllegalAssignmentError
- when this AsyncBaseEvent cannot
hold a reference to handlerhandler
- The instance of AsyncBaseEventHandler to
be associated with this. When handler is
null then no handler will be associated
with this, i.e., behave effectively as if
setHandler(null) invokes
removeHandler(AsyncBaseEventHandler) for
each associated handler.public void removeHandler(AsyncBaseEventHandler handler)
handler
- The handler to be disassociated from this. When
null nothing happens. When the handler is not
already associated with this then nothing happenspublic boolean hasHandlers()
public void enable()
public void disable()
public boolean isRunning()
public boolean handledBy(AsyncBaseEventHandler handler)
handler
- The handler to be tested to determine if it is
associated with this.public ReleaseParameters<?> createReleaseParameters()
StaticUnsupportedOperationException
- always, since it is
not yet implemented.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2022 aicas GmbH. All Rights Reserved.