|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.realtime.AsyncEventHandler
An asynchronous event handler encapsulates code that gets run at
some time after an AsyncEvent occurs. It is essentially a
java.lang.Runnable with a set of parameter objects, making it very
much like a RealtimeThread . The expectation is that there may be
thousands of events, with corresponding handlers, averaging about
one handler per event. The number of unblocked (i.e., scheduled)
handlers is expected to be relatively small.
It is guaranteed that multiple firings of an event handler will be
serialized. It is also guaranteed that (unless the handler
explicitly chooses otherwise) for each firing of the handler, there
will be one execution of the handleAsyncEvent() method. For
instances of AsyncEventHandler with a release parameter of type
SporadicParameters have a list of release times which correspond to
execution times of AsyncEvent.fire() . The minimum interarrival
time specified in SporadicParameters is enforced as defined
there. Unless the handler explicitly chooses otherwise there will
be one execution of the code in handleAsyncEvent() for each entry
in the list. The i th execution of handleAsyncEvent() will be
released for scheduling at the time of the i th entry in thelist.
There is no restriction on what handlers may do. They may run for a
long or short time, and they may block. (Note: blocked handlers may
hold system resources.) Normally, handlers are bound to an
execution context dynamically, when their AsyncEvent181 occurs.
This can introduce a (small) time penalty. For critical handlers
that can not afford the expense, and where this penalty is a
problem, use a BoundAsyncEventHandler. The semantics for memory
areas that were defined for realtime threads apply in the same way
to instances of AsyncEventHandler They may inherit a scope stack
when they are created, and the single parent rule applies to the
use of memory scopes for instances of AsyncEventHandler just as it
does in realtime threads.
| Constructor Summary | |
AsyncEventHandler()
|
|
AsyncEventHandler(boolean nonheap)
|
|
AsyncEventHandler(boolean nonheap,
Runnable logic)
|
|
AsyncEventHandler(Runnable logic)
|
|
AsyncEventHandler(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
MemoryArea area,
ProcessingGroupParameters group,
boolean nonheap)
|
|
AsyncEventHandler(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
MemoryArea area,
ProcessingGroupParameters group,
boolean nonheap,
Runnable logic)
|
|
AsyncEventHandler(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
MemoryArea area,
ProcessingGroupParameters group,
Runnable logic)
|
|
| Method Summary | |
boolean |
addIfFeasible()
Add to the feasibility of the associated scheduler if the resulting feasibility is Schedulable. |
boolean |
addToFeasibility()
Inform the scheduler and cooperating facilities that the resource demands (as expressed in the associated instances of SchedulingParameters, ReleaseParameters, MemoryParameters, and ProcessingGroupParameters) of this instance of Schedulable will be considered in the feasibility analysis of
the associated Scheduler until further notice. |
int |
executionEligibility()
|
protected void |
finalize()
|
MemoryArea |
getMemoryArea()
|
MemoryParameters |
getMemoryParameters()
Get the MemoryParameters of this Schedulable
object. |
ProcessingGroupParameters |
getProcessingGroupParameters()
Get the ProcessingGroupParameters of this
Schedulable object. |
ReleaseParameters |
getReleaseParameters()
Get the ReleaseParameters of this Schedulable
object. |
Scheduler |
getScheduler()
Get the Scheduler for this Schedulable object. |
SchedulingParameters |
getSchedulingParameters()
Get the SchedulingParameters for this Schedulable object. |
void |
handleAsyncEvent()
If this handler was constructed using a separate Runnable logic object, then that Runnable objects
run method is called; This method will be invoked
repeatedly while fireCount is greater than zero. |
boolean |
removeFromFeasibility()
Inform the scheduler and cooperating facilities that the resource demands, as expressed in the associated instances of SchedulingParameters, ReleaseParameters, MemoryParameters, and ProcessingGroupParameters, of
this instance of Schedulable should no longer be
considered in the feasibility analysis of the associated Scheduler. |
void |
run()
Used by the asynchronous event mechanism, see AsyncEvent. |
void |
setDaemon(boolean on)
|
boolean |
setIfFeasible(ReleaseParameters release,
MemoryParameters memory)
|
boolean |
setIfFeasible(ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
|
boolean |
setIfFeasible(ReleaseParameters release,
ProcessingGroupParameters group)
|
boolean |
setIfFeasible(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory)
|
boolean |
setIfFeasible(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
|
void |
setMemoryParameters(MemoryParameters memory)
Set the MemoryParameters for this Schedulable
object. |
boolean |
setMemoryParametersIfFeasible(MemoryParameters memory)
Set the MemoryParameters for this Schedulable
object. |
void |
setProcessingGroupParameters(ProcessingGroupParameters group)
Set the ProcessingGroupParameters for this Schedulable object. |
boolean |
setProcessingGroupParametersIfFeasible(ProcessingGroupParameters group)
Set the ProcessingGroupParameters of this Schedulable object
only if the resulting task set is feasible. |
void |
setReleaseParameters(ReleaseParameters release)
Set the ReleaseParameters for this Schedulable
object. |
boolean |
setReleaseParametersIfFeasible(ReleaseParameters release)
Set the ReleaseParameters for this Schedulable object only if
the resulting task set is feasible. |
void |
setScheduler(Scheduler scheduler)
Set the Scheduler for this Schedulable object. |
void |
setScheduler(Scheduler scheduler,
SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
Set the Scheduler for this Schedulable object. |
void |
setSchedulingParameters(SchedulingParameters scheduling)
Set the SchedulingParameters for this Schedulable object only if the resulting task set is feasible. |
boolean |
setSchedulingParametersIfFeasible(SchedulingParameters scheduling)
Set the SchedulingParameters for this Schedulable object. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AsyncEventHandler()
public AsyncEventHandler(boolean nonheap)
public AsyncEventHandler(boolean nonheap,
Runnable logic)
public AsyncEventHandler(Runnable logic)
public AsyncEventHandler(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
MemoryArea area,
ProcessingGroupParameters group,
boolean nonheap)
public AsyncEventHandler(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
MemoryArea area,
ProcessingGroupParameters group,
Runnable logic)
public AsyncEventHandler(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
MemoryArea area,
ProcessingGroupParameters group,
boolean nonheap,
Runnable logic)
| Method Detail |
public void handleAsyncEvent()
Runnable objects
run method is called; This method will be invoked
repeatedly while fireCount is greater than zero.
public MemoryArea getMemoryArea()
public boolean addToFeasibility()
SchedulableSchedulable will be considered in the feasibility analysis of
the associated Scheduler until further notice. Whether the
resulting system is feasible or not, the addition is completed.
addToFeasibility in interface Schedulablepublic boolean addIfFeasible()
SchedulableSchedulable. If successful return
true, if not return false. If there is not assigned scheduler
false is returned.
addIfFeasible in interface Schedulable
public boolean setIfFeasible(ReleaseParameters release,
MemoryParameters memory)
setIfFeasible in interface Schedulable
public boolean setIfFeasible(ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
setIfFeasible in interface Schedulable
public boolean setIfFeasible(ReleaseParameters release,
ProcessingGroupParameters group)
setIfFeasible in interface Schedulable
public boolean setIfFeasible(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory)
setIfFeasible in interface Schedulable
public boolean setIfFeasible(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
setIfFeasible in interface Schedulablepublic boolean setReleaseParametersIfFeasible(ReleaseParameters release)
SchedulableReleaseParameters for this Schedulable object only if
the resulting task set is feasible.
setReleaseParametersIfFeasible in interface Schedulablerelease - a ReleaseParameters valuepublic boolean setProcessingGroupParametersIfFeasible(ProcessingGroupParameters group)
SchedulableProcessingGroupParameters of this Schedulable object
only if the resulting task set is feasible.
setProcessingGroupParametersIfFeasible in interface Schedulablegroup - a ProcessingGroupParameters value
public boolean setMemoryParametersIfFeasible(MemoryParameters memory)
SchedulableMemoryParameters for this Schedulable
object.
setMemoryParametersIfFeasible in interface Schedulablememory - the MemoryParameters for this Schedulable object
public MemoryParameters getMemoryParameters()
SchedulableMemoryParameters of this Schedulable
object.
getMemoryParameters in interface SchedulableMemoryParameters valuepublic ReleaseParameters getReleaseParameters()
SchedulableReleaseParameters of this Schedulable
object.
getReleaseParameters in interface SchedulableReleaseParameters valuepublic Scheduler getScheduler()
SchedulableScheduler for this Schedulable object.
getScheduler in interface SchedulableScheduler valuepublic SchedulingParameters getSchedulingParameters()
SchedulableSchedulingParameters for this Schedulable object.
getSchedulingParameters in interface SchedulableSchedulingParameters valuepublic ProcessingGroupParameters getProcessingGroupParameters()
SchedulableProcessingGroupParameters of this
Schedulable object.
getProcessingGroupParameters in interface SchedulableProcessingGroupParameters valuepublic boolean removeFromFeasibility()
SchedulableSchedulingParameters, ReleaseParameters, MemoryParameters, and ProcessingGroupParameters, of
this instance of Schedulable should no longer be
considered in the feasibility analysis of the associated Scheduler. Whether the resulting system is feasible or not,
the subtrac-tion is completed.
removeFromFeasibility in interface Schedulablepublic void setMemoryParameters(MemoryParameters memory)
SchedulableMemoryParameters for this Schedulable
object.
setMemoryParameters in interface Schedulablememory - the MemoryParameters for this Schedulable objectpublic void setReleaseParameters(ReleaseParameters release)
SchedulableReleaseParameters for this Schedulable
object.
setReleaseParameters in interface Schedulablerelease - a ReleaseParameters valuepublic void setScheduler(Scheduler scheduler)
SchedulableScheduler for this Schedulable object.
setScheduler in interface Schedulablescheduler - the scheduler.
public void setScheduler(Scheduler scheduler,
SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
SchedulableScheduler for this Schedulable object.
setScheduler in interface Schedulablescheduler - a Scheduler valuescheduling - a SchedulingParameters valuerelease - a ReleaseParameters valuememory - a MemoryParameters valuegroup - a ProcessingGroupParameters valuepublic void setSchedulingParameters(SchedulingParameters scheduling)
SchedulableSchedulingParameters for this Schedulable object only if the resulting task set is feasible.
setSchedulingParameters in interface Schedulablescheduling - a SchedulingParameters valuepublic boolean setSchedulingParametersIfFeasible(SchedulingParameters scheduling)
SchedulableSchedulingParameters for this Schedulable object.
setSchedulingParametersIfFeasible in interface Schedulablescheduling - a SchedulingParameters value
public void setProcessingGroupParameters(ProcessingGroupParameters group)
SchedulableProcessingGroupParameters for this Schedulable object.
setProcessingGroupParameters in interface Schedulablegroup - a ProcessingGroupParameters valuepublic final void setDaemon(boolean on)
public final void run()
AsyncEvent. This method invokes
handleAsyncEvent() repeatedly while the fire count
is greater than zero. Applications cannot override this method
and should thus override handleAsyncEvent() in
subclasses with the logic of the handler.
run in interface Runnableprotected void finalize()
public int executionEligibility()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||