|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.realtime.AsyncEventHandler
javax.realtime.BoundAsyncEventHandler
A bound asynchronous event handler is an asynchronous event handler that is permanently bound to a thread. Bound asynchronous event handlers are meant for use in situations where the added timeliness is worth the overhead of binding the handler to a thread.
| Field Summary | |
protected boolean |
active
|
protected Runnable |
logic
|
protected RealtimeThread |
thread
|
| Fields inherited from class javax.realtime.AsyncEventHandler |
executionEligibility, natFireCount_ |
| Constructor Summary | |
BoundAsyncEventHandler()
Creates a new BoundAsyncEventHandler instance whose
SchedulingParameters are inherited from the current thread
and does not have either ReleaseParameters or
MemoryParameters. |
|
BoundAsyncEventHandler(boolean noHeap)
Creates a new BoundAsyncEventHandler instance whose
parameters are inherited from the current thread, if it is a
RealtimeThread ,or null other wise. |
|
BoundAsyncEventHandler(boolean noHeap,
Runnable logic)
Creates a new BoundAsyncEventHandler instance whose
parameters are inherited from the current thread, if it is a
RealtimeThread, or null otherwise. |
|
BoundAsyncEventHandler(Runnable logic)
Creates a new BoundAsyncEventHandler instance whose
parameters are inherited from the current thread, if it is a
RealtimeThread, or null otherwise. |
|
BoundAsyncEventHandler(SchedulingParameters schedulingParam,
ReleaseParameters releaseParam,
MemoryParameters memoryParam,
MemoryArea memoryArea,
ProcessingGroupParameters groupParam,
boolean noHeap)
Creates a new BoundAsyncEventHandler instance with the
specified parameters. |
|
BoundAsyncEventHandler(SchedulingParameters schedulingParam,
ReleaseParameters releaseParam,
MemoryParameters memoryParam,
MemoryArea memoryArea,
ProcessingGroupParameters groupParam,
boolean noHeap,
Runnable logic)
Creates a new BoundAsyncEventHandler instance with the
specified parameters. |
|
BoundAsyncEventHandler(SchedulingParameters schedulingParam,
ReleaseParameters releaseParam,
MemoryParameters memoryParam,
MemoryArea memoryArea,
ProcessingGroupParameters groupParam,
Runnable logic)
Creates a new BoundAsyncEventHandler instance with the
specified parameters. |
|
| Method Summary | |
void |
activate()
This method is provided to give more control over the time at which the thread bound with this AsyncEventHandler is
started. |
boolean |
addIfFeasible()
Add to the feasibility of the already set scheduler if the resulting feasibility set 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. |
void |
deactivate()
|
int |
executionEligibility()
NOTE: This method is not part of the RTSJ Specification. |
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 object s
run method is called; This method will be invoked
repeatedly while fireCount is greater than zero. |
protected void |
handleAsyncEventImpl()
|
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 |
setMemoryParameters(MemoryParameters memoryParam)
Set the MemoryParameters for this schedulable object. |
boolean |
setMemoryParametersIfFeasible(MemoryParameters memoryParam)
Returns true if, after considering the value of the parameter, the task set would still be feasible. |
void |
setProcessingGroupParameters(ProcessingGroupParameters groupParam)
Set the ProcessingGroupParameters for this schedulable object. |
boolean |
setProcessingGroupParametersIfFeasible(ProcessingGroupParameters groupParam)
Set the ProcessingGroupParameters of this schedulable object
only if the resulting task set is feasible. |
void |
setReleaseParameters(ReleaseParameters releaseParam)
Set the ReleaseParametersfor this schedulable object. |
boolean |
setReleaseParametersIfFeasible(ReleaseParameters releaseParam)
Returns true if, after considering the value of the parameter, the task set would still be feasible. |
void |
setScheduler(Scheduler scheduler)
Set the Scheduler for this schedulable object. |
void |
setScheduler(Scheduler scheduler,
SchedulingParameters schedulingParam,
ReleaseParameters releaseParam,
MemoryParameters memoryParam,
ProcessingGroupParameters groupParam)
Set the Scheduler for this schedulable object. |
void |
setSchedulingParameters(SchedulingParameters schedulingParam)
Set the SchedulingParameters for this schedulable
object only if the resulting task set is feasible. |
boolean |
setSchedulingParametersIfFeasible(SchedulingParameters schedulingParam)
Set the SchedulingParameters for this schedulable object. |
| Methods inherited from class javax.realtime.AsyncEventHandler |
finalize, getAndClearPendingFireCount, getAndDecrementPendingFireCount, getAndIncrementPendingFireCount, getPendingFireCount, run |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected RealtimeThread thread
protected boolean active
protected Runnable logic
| Constructor Detail |
public BoundAsyncEventHandler()
BoundAsyncEventHandler instance whose
SchedulingParameters are inherited from the current thread
and does not have either ReleaseParameters or
MemoryParameters.
public BoundAsyncEventHandler(boolean noHeap)
BoundAsyncEventHandler instance whose
parameters are inherited from the current thread, if it is a
RealtimeThread ,or null other wise.
noHeap - A flag meaning, when true, that this
will have characteristics identical to a NoHeapRealtimeThread. A false value means this will have
characteristics identical to a RealtimeThread. If
true and the current thread is not a NoHeapRealtimeThread or a RealtimeThread executing
within a ScopedMemory or ImmortalMemory scope
then an IllegalArgumentException is thrown.public BoundAsyncEventHandler(Runnable logic)
BoundAsyncEventHandler instance whose
parameters are inherited from the current thread, if it is a
RealtimeThread, or null otherwise.
logic - The java.lang.Runnable object whose
run is executed by handleAsyncEvent.
public BoundAsyncEventHandler(boolean noHeap,
Runnable logic)
throws IllegalArgumentException
BoundAsyncEventHandler instance whose
parameters are inherited from the current thread, if it is a
RealtimeThread, or null otherwise.
noHeap - A flag meaning, when true, that this
will have characteristics identical to a NoHeapRealtimeThread. A false value means this will have
characteristics identical to a RealtimeThread. If
true and the current thread is not a NoHeapRealtimeThread or a RealtimeThread executing
within a ScopedMemory or ImmortalMemory scope
then an IllegalArgumentException is thrown.logic - -The java.lang.Runnable object whose
run is executed by handleAsyncEvent.
IllegalArgumentException
public BoundAsyncEventHandler(SchedulingParameters schedulingParam,
ReleaseParameters releaseParam,
MemoryParameters memoryParam,
MemoryArea memoryArea,
ProcessingGroupParameters groupParam,
boolean noHeap)
throws IllegalArgumentException
BoundAsyncEventHandler instance with the
specified parameters.
schedulingParam - a SchedulingParameters value
which will be associated with the constructed instance of this.
If null this will be assigned the reference to the
SchedulingParameters of the current thread.releaseParam - a ReleaseParameters value
which will be associated with the constructed instance of this.
If null this will have no ReleaseParameters.memoryParam - a MemoryParameters value which
will be associated with the constructed instance of this. If
null this will have no MemoryParameters.memoryArea - The MemoryArea for this
BoundAsyncEventHandler. If null, inherit the current
memory area at the time of construction. The initial memory
area must be a reference to a ScopedMemory or ImmortalMemory object if noheap is
true.groupParam - A ProcessingGroupParameters object
to which this will be associated. If null this will not be
associated with any processing group.noHeap - A flag meaning, when true, that this
will have characteristics identical to a NoHeapRealtimeThread. A false value means this will have
characteristics identical to a RealtimeThread. If
true and the current thread is not a NoHeapRealtimeThread or a RealtimeThread executing
within a ScopedMemory or ImmortalMemory scope
then an IllegalArgumentException is thrown.
IllegalArgumentException
public BoundAsyncEventHandler(SchedulingParameters schedulingParam,
ReleaseParameters releaseParam,
MemoryParameters memoryParam,
MemoryArea memoryArea,
ProcessingGroupParameters groupParam,
Runnable logic)
throws IllegalArgumentException
BoundAsyncEventHandler instance with the
specified parameters.
schedulingParam - a SchedulingParameters value
which will be associated with the constructed instance of this.
If null this will be assigned the reference to the
SchedulingParameters of the current thread.releaseParam - a ReleaseParameters value
which will be associated with the constructed instance of this.
If null this will have no ReleaseParameters.memoryParam - a MemoryParameters value which
will be associated with the constructed instance of this. If
null this will have no MemoryParameters.memoryArea - The MemoryArea for this
BoundAsyncEventHandler. If null, inherit the current
memory area at the time of construction. The initial memory
area must be a reference to a ScopedMemory or ImmortalMemory object if noheap is
true.groupParam - A ProcessingGroupParameters object
to which this will be associated. If null this will not be
associated with any processing group.logic - The java.lang.Runnable object whose
run is executed by handleAsyncEvent.
IllegalArgumentException
public BoundAsyncEventHandler(SchedulingParameters schedulingParam,
ReleaseParameters releaseParam,
MemoryParameters memoryParam,
MemoryArea memoryArea,
ProcessingGroupParameters groupParam,
boolean noHeap,
Runnable logic)
throws IllegalArgumentException
BoundAsyncEventHandler instance with the
specified parameters.
schedulingParam - a SchedulingParameters value
which will be associated with the constructed instance of this.
If null this will be assigned the reference to the
SchedulingParameters of the current thread.releaseParam - a ReleaseParameters value
which will be associated with the constructed instance of this.
If null this will have no ReleaseParameters.memoryParam - a MemoryParameters value which
will be associated with the constructed instance of this. If
null this will have no MemoryParameters.memoryArea - The MemoryArea for this
BoundAsyncEventHandler. If null, inherit the current
memory area at the time of construction. The initial memory
area must be a reference to a ScopedMemory or ImmortalMemory object if noheap is
true.groupParam - A ProcessingGroupParameters object
to which this will be associated. If null this will not be
associated with any processing group.noHeap - A flag meaning, when true, that this
will have characteristics identical to a NoHeapRealtimeThread. A false value means this will have
characteristics identical to a RealtimeThread. If
true and the current thread is not a NoHeapRealtimeThread or a RealtimeThread executing
within a ScopedMemory or ImmortalMemory scope
then an IllegalArgumentException is thrown.logic - The java.lang.Runnable object whose
run is executed by handleAsyncEvent.
IllegalArgumentException| Method Detail |
public void handleAsyncEvent()
Runnable object s
run method is called; This method will be invoked
repeatedly while fireCount is greater than zero.
handleAsyncEvent in class AsyncEventHandlerprotected void handleAsyncEventImpl()
public void activate()
AsyncEventHandler is
started. If this method is not invoked to explicitly start the
dispatch thread, it will then be started upon arrival of the first event.
public void deactivate()
public boolean addIfFeasible()
public boolean addToFeasibility()
public MemoryParameters getMemoryParameters()
MemoryParameters of this schedulable object.
MemoryParameters value.public void setMemoryParameters(MemoryParameters memoryParam)
MemoryParameters for this schedulable object.
memoryParam - the MemoryParameters for this
schedulable object.public boolean setMemoryParametersIfFeasible(MemoryParameters memoryParam)
memoryParam - the MemoryParameters for this
schedulable object.
public ProcessingGroupParameters getProcessingGroupParameters()
ProcessingGroupParameters of this
schedulable object.
ProcessingGroupParameters valuepublic void setProcessingGroupParameters(ProcessingGroupParameters groupParam)
ProcessingGroupParameters for this schedulable object.
groupParam - a ProcessingGroupParameters valuepublic boolean setProcessingGroupParametersIfFeasible(ProcessingGroupParameters groupParam)
ProcessingGroupParameters of this schedulable object
only if the resulting task set is feasible.
groupParam - a ProcessingGroupParameters value
public ReleaseParameters getReleaseParameters()
ReleaseParameters of this schedulable object.
ReleaseParameters valuepublic void setReleaseParameters(ReleaseParameters releaseParam)
ReleaseParametersfor this schedulable object.
releaseParam - a ReleaseParameters valuepublic boolean setReleaseParametersIfFeasible(ReleaseParameters releaseParam)
releaseParam - a ReleaseParameters valuepublic Scheduler getScheduler()
Scheduler for this schedulable object.
Scheduler value
public void setScheduler(Scheduler scheduler)
throws IllegalThreadStateException
Scheduler for this schedulable object.
scheduler - the scheduler.
IllegalThreadStateException
public void setScheduler(Scheduler scheduler,
SchedulingParameters schedulingParam,
ReleaseParameters releaseParam,
MemoryParameters memoryParam,
ProcessingGroupParameters groupParam)
throws IllegalThreadStateException
Scheduler for this schedulable object.
scheduler - a Scheduler valueschedulingParam - a SchedulingParameters valuereleaseParam - a ReleaseParameters valuememoryParam - a MemoryParameters valuegroupParam - a ProcessingGroupParameters value
IllegalThreadStateException - if an error occurspublic SchedulingParameters getSchedulingParameters()
SchedulingParameters for this schedulable object.
SchedulingParameters valuepublic void setSchedulingParameters(SchedulingParameters schedulingParam)
SchedulingParameters for this schedulable
object only if the resulting task set is feasible.
schedulingParam - a SchedulingParameters valuepublic boolean setSchedulingParametersIfFeasible(SchedulingParameters schedulingParam)
SchedulingParameters for this schedulable object.
schedulingParam - a SchedulingParameters value
public boolean removeFromFeasibility()
SchedulingParameters, 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.
public int executionEligibility()
Schedulable
int value used internally to represent
a total ordering of the schedulable entities.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||