javax.realtime
Interface Schedulable

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
AsyncEventHandler, RealtimeThread

public interface Schedulable
extends java.lang.Runnable

Handlers and other objects can be run by a Scheduler if they provide a run() method and the methods defined below. The Scheduler uses this information to create a suitable context to execute the run() method.


Method Summary
 boolean addIfFeasible()
          Add the scheduling and release characteristics of this to the set of such chracteristics already being considered, if the addition would result in the new, larger set being feasible.
 boolean addToFeasibility()
          Inform the scheduler and cooperating facilities that scheduling and release characteristics of this instance of Schedulable should be considered in feasibility analysis until further notified.
 javax.realtime.MemoryParameters getMemoryParameters()
          Gets a reference to the MemoryParameters object.
 javax.realtime.ProcessingGroupParameters getProcessingGroupParameters()
          Gets a reference to the ProcessingGroupParameters object.
 javax.realtime.ReleaseParameters getReleaseParameters()
          Gets a reference to the ReleaseParameters object.
 javax.realtime.Scheduler getScheduler()
          Gets a reference to the Scheduler object.
 javax.realtime.SchedulingParameters getSchedulingParameters()
          Gets a reference to the SchedulingParameters object.
 long getUID()
          Return a UID for this Schedulable object.
 void removeFromFeasibility()
          Inform the scheduler and cooperating facilities that scheduling and release characteristics of this instance of Schedulable should not be considered in feasibility analysis until further notified.
 boolean setIfFeasible(javax.realtime.ReleaseParameters release, javax.realtime.MemoryParameters memory)
          This method appears in many classes in the RTSJ and with various parameters.
 boolean setIfFeasible(javax.realtime.ReleaseParameters release, javax.realtime.MemoryParameters memory, javax.realtime.ProcessingGroupParameters group)
          This method appears in many classes in the RTSJ and with various parameters.
 boolean setIfFeasible(javax.realtime.ReleaseParameters release, javax.realtime.ProcessingGroupParameters group)
          This method appears in many classes in the RTSJ and with various parameters.
 void setMemoryParameters(javax.realtime.MemoryParameters memory)
          Sets the memory parameters associated with this instance of Schedulable.
 boolean setMemoryParametersIfFeasible(javax.realtime.MemoryParameters memParam)
          The method first performs a feasibility analysis using the given memory parameters as replacements for the memory parameters of this.
 void setProcessingGroupParameters(javax.realtime.ProcessingGroupParameters pgp)
          Sets the ProcessingGroupParameters of this only if the resulting set of scheduling and release characteristics is feasible.
 boolean setProcessingGroupParametersIfFeasible(javax.realtime.ProcessingGroupParameters groupParameters)
          Sets the ProcessingGroupParameters of this only if the resulting set of scheduling and release characteristics is feasible.
 void setReleaseParameters(javax.realtime.ReleaseParameters release)
          Sets the release parameters associated with this instance of Schedulable.
 boolean setReleaseParametersIfFeasible(javax.realtime.ReleaseParameters release)
          Set the ReleaseParameters for this schedulable object only if the resulting set of scheduling and release characteristics is feasible.
 void setScheduler(javax.realtime.Scheduler scheduler)
          Sets the reference to the Scheduler object.
 void setScheduler(javax.realtime.Scheduler scheduler, javax.realtime.SchedulingParameters scheduling, javax.realtime.ReleaseParameters release, javax.realtime.MemoryParameters memoryParameters, javax.realtime.ProcessingGroupParameters processingGroup)
          Sets the reference to the Scheduler object.
 void setSchedulingParameters(javax.realtime.SchedulingParameters scheduling)
          Sets the reference to the SchedulingParameters object.
 boolean setSchedulingParametersIfFeasible(javax.realtime.SchedulingParameters scheduling)
          The method first performs a feasibility analysis using the given scheduling parameters as replacements for the scheduling parameters of this.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

addIfFeasible

public boolean addIfFeasible()
Add the scheduling and release characteristics of this to the set of such chracteristics already being considered, if the addition would result in the new, larger set being feasible.

Returns:
True, if the addition would result in the set of considered characteristics being feasible. False, if the addition would result in the sed of considered characteristics being infeasible or there is no assigned instance of Scheduler.

addToFeasibility

public boolean addToFeasibility()
Inform the scheduler and cooperating facilities that scheduling and release characteristics of this instance of Schedulable should be considered in feasibility analysis until further notified.

Returns:
True, if the addition was successful. False, if not.

getMemoryParameters

public javax.realtime.MemoryParameters getMemoryParameters()
Gets a reference to the MemoryParameters object.

Returns:
A reference to the current MemoryParameters object.

getProcessingGroupParameters

public javax.realtime.ProcessingGroupParameters getProcessingGroupParameters()
Gets a reference to the ProcessingGroupParameters object.

Returns:
A reference to the current ProcessingGroupParameters object.

getReleaseParameters

public javax.realtime.ReleaseParameters getReleaseParameters()
Gets a reference to the ReleaseParameters object.

Returns:
A reference to the current ReleaseParameters object.

getSchedulingParameters

public javax.realtime.SchedulingParameters getSchedulingParameters()
Gets a reference to the SchedulingParameters object.

Returns:
A reference to the current SchedulingParameters object.

getScheduler

public javax.realtime.Scheduler getScheduler()
Gets a reference to the Scheduler object.

Returns:
A reference to the current Scheduler object.

removeFromFeasibility

public void removeFromFeasibility()
Inform the scheduler and cooperating facilities that scheduling and release characteristics of this instance of Schedulable should not be considered in feasibility analysis until further notified.

Returns:
True, if the removal was successful. False, if not.

setIfFeasible

public boolean setIfFeasible(javax.realtime.ReleaseParameters release,
                             javax.realtime.MemoryParameters memory)
This method appears in many classes in the RTSJ and with various parameters. The parameters are either new scheduling characteristics for an instance of Schedulable or an instance of Schedulable. The method first performs a feasibility analysis using the new scheduling characteristics of either this or the given instance of Schedulable. If the resulting system is feasible the method replaces the current sheduling characteristics, of either this or the given instance of Schedulable as appropriate, with the new scheduling characteristics.

Parameters:
release - The proposed release parameters.
memory - The proposed memory parameters.
Returns:
True, if the resulting system is feasible and the changes are made. False, if the resulting system is not feasible and no changes are made.

setIfFeasible

public boolean setIfFeasible(javax.realtime.ReleaseParameters release,
                             javax.realtime.MemoryParameters memory,
                             javax.realtime.ProcessingGroupParameters group)
This method appears in many classes in the RTSJ and with various parameters. The parameters are either new scheduling characteristics for an instance of Schedulable or an instance of Schedulable. The method first performs a feasibility analysis using the new scheduling characteristics of either this or the given instance of Schedulable. If the resulting system is feasible the method replaces the current sheduling characteristics, of either this or the given instance of Schedulable as appropriate, with the new scheduling characteristics.

Parameters:
release - The proposed release parameters.
memory - The proposed memory parameters.
group - The proposed processing group parameters.
Returns:
True, if the resulting system is feasible and the changes are made. False, if the resulting system is not feasible and no changes are made.

setIfFeasible

public boolean setIfFeasible(javax.realtime.ReleaseParameters release,
                             javax.realtime.ProcessingGroupParameters group)
This method appears in many classes in the RTSJ and with various parameters. The parameters are either new scheduling characteristics for an instance of Schedulable or an instance of Schedulable. The method first performs a feasibility analysis using the new scheduling characteristics of either this or the given instance of Schedulable. If the resulting system is feasible the method replaces the current sheduling characteristics, of either this or the given instance of Schedulable as appropriate, with the new scheduling characteristics.

Parameters:
release - The proposed release parameters.
group - The proposed processing group parameters.
Returns:
True, if the resulting system is fesible and the changes are made. False, if the resulting system is not feasible and no changes are made.

setMemoryParameters

public void setMemoryParameters(javax.realtime.MemoryParameters memory)
Sets the memory parameters associated with this instance of Schedulable.

Parameters:
memory - A MemoryParameters object which will become the memory parameters associated with this after the method call.

setMemoryParametersIfFeasible

public boolean setMemoryParametersIfFeasible(javax.realtime.MemoryParameters memParam)
The method first performs a feasibility analysis using the given memory parameters as replacements for the memory parameters of this. If the resulting system is feasible the method replaces the current memory parameterers of this with the new memory parameters.

Parameters:
memParam - The proposed memory Parameters
Returns:
True, if the resulting system is feasible and the changes are made. False, if the resulting system is not feasible and no changes are made.

setProcessingGroupParameters

public void setProcessingGroupParameters(javax.realtime.ProcessingGroupParameters pgp)
Sets the ProcessingGroupParameters of this only if the resulting set of scheduling and release characteristics is feasible.

Parameters:
pgp - The ProcessingGroupParameters object. If null, nothing happens.
Returns:
True, if the resulting system is feasible and the changes are made. False, if the resulting system is not feasible and no changes are made.

setProcessingGroupParametersIfFeasible

public boolean setProcessingGroupParametersIfFeasible(javax.realtime.ProcessingGroupParameters groupParameters)
Sets the ProcessingGroupParameters of this only if the resulting set of scheduling and release characteristics is feasible.

Parameters:
groupParameters - The ProcessingGroupParameters object. If null, nothing happens.
Returns:
True, if the resulting system is feasible and the changes are made. False, if the resulting system is not feasible and no changes are made.

setReleaseParameters

public void setReleaseParameters(javax.realtime.ReleaseParameters release)
Sets the release parameters associated with this instance of Schedulable. Since this affects the constraints expressed in the release parameters of the existing schedulable objects, this may change the feasibility of the current schedule.

Parameters:
release - A ReleaseParameters object which will become the release parameters associated with this after the method call.

setReleaseParametersIfFeasible

public boolean setReleaseParametersIfFeasible(javax.realtime.ReleaseParameters release)
Set the ReleaseParameters for this schedulable object only if the resulting set of scheduling and release characteristics is feasible.

Parameters:
release - The ReleaseParameters object. If null, nothing happens.
Returns:
True, if the resulting system is feasible and the changes are made. False, if the resulting system is not feasible and no changes are made.

setSchedulingParameters

public void setSchedulingParameters(javax.realtime.SchedulingParameters scheduling)
Sets the reference to the SchedulingParameters object.

Parameters:
scheduling - A reference to the SchedulingParameters object.
Throws:
java.lang.IllegalThreadStateException - Thrown when: ((Thread.isAlive() && Not Blocked) == true). (Where blocked means waiting in Thread.wait(), Thread.join() or Thread.sleep()).

setSchedulingParametersIfFeasible

public boolean setSchedulingParametersIfFeasible(javax.realtime.SchedulingParameters scheduling)
The method first performs a feasibility analysis using the given scheduling parameters as replacements for the scheduling parameters of this. If the resulting system is feasible the method replaces the current scheduling parameters of this with the new scheduling parameters.

Parameters:
scheduling - The proposed scheduling parameters.
Returns:
True, if the resulting system is feasible and the chagens are made. False, if the resulting system is not feasible and no changes are made.

setScheduler

public void setScheduler(javax.realtime.Scheduler scheduler)
                  throws java.lang.IllegalThreadStateException
Sets the reference to the Scheduler object.

Parameters:
scheduler - A reference to the Scheduler object.
Throws:
java.lang.IllegalThreadStateException - Thrown when: ((Thread.isAlive() && Not Blocked) == true). (Where blocked means waiting in Thread.wait(), Thread.join() or Thread.sleep()).

setScheduler

public void setScheduler(javax.realtime.Scheduler scheduler,
                         javax.realtime.SchedulingParameters scheduling,
                         javax.realtime.ReleaseParameters release,
                         javax.realtime.MemoryParameters memoryParameters,
                         javax.realtime.ProcessingGroupParameters processingGroup)
                  throws java.lang.IllegalThreadStateException
Sets the reference to the Scheduler object.

Parameters:
scheduler - A reference to the Scheduler object.
scheduling - A reference to the SchedulingParameters which will be associated with this. If null, no changes to current value of this parameter is made.
release - A reference to the ReleaseParameters which will be associated with this. If null, no change to current value of this parameter is made.
memoryParameters - A reference to the MemoryParaemters which will be associated with this. If null, no change to current value of this parameter is made.
processingGroup - A reference to the ProcessingGroupParameters which will be associated with this. If null, no change to current value of this parameter is made.
Throws:
java.lang.IllegalThreadStateException - Thrown when: ((Thread.isAlive() && Not Blocked) == true). (Where blocked means waiting in Thread.wait(), Thread.join() or Thread.sleep()).

getUID

public long getUID()
Return a UID for this Schedulable object.