java.lang.Objectjava.lang.Thread
javax.realtime.RealtimeThread
public class RealtimeThread
Class RealtimeThread
extends Thread
and adds access to real-time services
such as asynchronous transfer of control, non-heap memory, and advanced scheduler services.
As with java.lang.Thread
, there are two ways to create a
usable RealtimeThread
.
RealtimeThread
and override the run()
method with
the logic for the thread.
RealtimeThread
using one of the constructors
with a logic
parameter. Pass a Runnable
object whose
run()
method implements the logic of the thread.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
RealtimeThread()
Create a real-time thread with default values for all parameters. |
|
RealtimeThread(SchedulingParameters scheduling)
Create a real-time thread with the given SchedulingParameters and default values for
all other parameters. |
|
RealtimeThread(SchedulingParameters scheduling,
ReleaseParameters release)
Create a real-time thread with the given SchedulingParameters and ReleaseParameters
and default values for all other parameters. |
|
RealtimeThread(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
MemoryArea area,
ProcessingGroupParameters group,
java.lang.Runnable logic)
Create a real-time thread with the given characteristics and a specified Runnable . |
Method Summary | |
---|---|
boolean |
addIfFeasible()
This method first performs a feasibility analysis with this
added to the system. |
boolean |
addToFeasibility()
Inform the scheduler and cooperating facilities that this instance of Schedulable should be considered in
feasibility analysis until further notified. |
static RealtimeThread |
currentRealtimeThread()
Gets a reference to the current instance of RealtimeThread . |
void |
deschedulePeriodic()
If the ReleaseParameters object associated with this
RealtimeThread is an instance of
is PeriodicParameters , perform any deschedulePeriodic
actions specified by
this thread's scheduler. |
static MemoryArea |
getCurrentMemoryArea()
Return a reference to the MemoryArea object representing the
current allocation context. |
static int |
getInitialMemoryAreaIndex()
Returns the position in the initial memory area stack, of the initial memory area for the current real-time thread. |
MemoryArea |
getMemoryArea()
Return the initial memory area for this RealtimeThread (corresponding to the
area parameter for the constructor.) |
static int |
getMemoryAreaStackDepth()
Gets the size of the stack of MemoryArea instances to
which the current schedulable object has access. |
MemoryParameters |
getMemoryParameters()
Gets a reference to the MemoryParameters object for this
schedulable object. |
static MemoryArea |
getOuterMemoryArea(int index)
Gets the instance of MemoryArea in the memory area stack
at the index given. |
ProcessingGroupParameters |
getProcessingGroupParameters()
Gets a reference to the ProcessingGroupParameters object for this
schedulable object. |
ReleaseParameters |
getReleaseParameters()
Gets a reference to the ReleaseParameters object for this
schedulable object. |
Scheduler |
getScheduler()
Gets a reference to the Scheduler object for this
schedulable object. |
SchedulingParameters |
getSchedulingParameters()
Gets a reference to the SchedulingParameters object for this
schedulable object. |
void |
interrupt()
Extends the function of Thread.interrupt() ,
generates the generic AsynchronouslyInterruptedException and
targets it at this, and sets the interrupted state to pending. |
boolean |
removeFromFeasibility()
Inform the scheduler and cooperating facilities that this instance of Schedulable should not be considered in
feasibility analysis until it is further notified. |
void |
schedulePeriodic()
Begin unblocking waitForNextPeriod() for a periodic thread. |
boolean |
setIfFeasible(ReleaseParameters release,
MemoryParameters memory)
This method first performs a feasibility analysis using the proposed parameter objects as replacements for the current parameters of this. |
boolean |
setIfFeasible(ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
This method first performs a feasibility analysis using the proposed parameter objects as replacements for the current parameters of this. |
boolean |
setIfFeasible(ReleaseParameters release,
ProcessingGroupParameters group)
This method first performs a feasibility analysis using the proposed parameter objects as replacements for the current parameters of this. |
boolean |
setIfFeasible(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory)
This method first performs a feasibility analysis using the proposed parameter objects as replacements for the current parameters of this. |
boolean |
setIfFeasible(SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
This method first performs a feasibility analysis using the proposed parameter objects as replacements for the current parameters of this. |
void |
setMemoryParameters(MemoryParameters memory)
Sets the memory parameters associated with this instance of Schedulable . |
boolean |
setMemoryParametersIfFeasible(MemoryParameters memory)
This method first performs a feasibility analysis using the proposed parameter object as replacement for the current parameter of this. |
void |
setProcessingGroupParameters(ProcessingGroupParameters group)
Sets the ProcessingGroupParameters of this . |
boolean |
setProcessingGroupParametersIfFeasible(ProcessingGroupParameters group)
This method first performs a feasibility analysis using the proposed parameter object as replacement for the current parameter of this. |
void |
setReleaseParameters(ReleaseParameters release)
Sets the release parameters associated with this instance of Schedulable . |
boolean |
setReleaseParametersIfFeasible(ReleaseParameters release)
This method first performs a feasibility analysis using the proposed parameter object as replacement for the current parameter of this. |
void |
setScheduler(Scheduler scheduler)
Sets the reference to the Scheduler object. |
void |
setScheduler(Scheduler scheduler,
SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memoryParameters,
ProcessingGroupParameters group)
Sets the scheduler and associated parameter objects. |
void |
setSchedulingParameters(SchedulingParameters scheduling)
Sets the scheduling parameters associated with this instance of Schedulable . |
boolean |
setSchedulingParametersIfFeasible(SchedulingParameters scheduling)
This method first performs a feasibility analysis using the proposed parameter object as replacement for the current parameter of this. |
static void |
sleep(Clock clock,
HighResolutionTime time)
A sleep method that is controlled by a generalized clock. |
static void |
sleep(HighResolutionTime time)
A sleep method that is controlled by a generalized clock. |
void |
start()
Set up the real-time thread's environment and start it. |
static boolean |
waitForNextPeriod()
Causes the current real-time thread to delay until the beginning of the next period. |
static boolean |
waitForNextPeriodInterruptible()
The waitForNextPeriodInterruptible() method is a
duplicate of waitForNextPeriod() except that
waitForNextPeriodInterruptible is able to throw
InterruptedException . |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
---|
run |
Constructor Detail |
---|
public RealtimeThread()
RealtimeThread(null, null, null, null, null, null)
.
public RealtimeThread(SchedulingParameters scheduling)
SchedulingParameters
and default values for
all other parameters. This constructor is
equivalent to RealtimeThread(scheduling, null, null, null, null, null)
.
java.lang.IllegalArgumentException
- Thrown if the scheduling parameters are not compatible with the associated scheduler.
IllegalAssignmentError
- Thrown if the new RealtimeThread
instance
cannot hold a reference to scheduling
, or if
scheduling
cannot hold a reference to the new RealtimeThread
.public RealtimeThread(SchedulingParameters scheduling, ReleaseParameters release)
SchedulingParameters
and ReleaseParameters
and default values for all other parameters.
This constructor is equivalent to
RealtimeThread(scheduling, release, null, null, null, null)
.
java.lang.IllegalArgumentException
- Thrown if the scheduling parameters or release
parameters are not compatible with the associated scheduler.
IllegalAssignmentError
- Thrown if the new RealtimeThread
instance
cannot hold a reference to scheduling
or release
, or if
either parameter cannot hold a reference to the new RealtimeThread
.public RealtimeThread(SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, MemoryArea area, ProcessingGroupParameters group, java.lang.Runnable logic)
Runnable
.
The thread group of the new thread is inherited from its creator unless the newly-created
real-time thread is allocated in scoped memory, then its thread group is (effectively) null.
The newly-created real-time thread is associated with the scheduler in effect during execution of the constructor.
scheduling
- The SchedulingParameters
associated with this
(And possibly other instances of
Schedulable
). If scheduling
is null and the creator is a schedulable
object, SchedulingParameters
is a clone of
the creator's value created in the same memory area as this
.
If scheduling
is null and the creator is a Java thread,
the contents and type of the
new SchedulingParameters
object is governed by the associated scheduler.release
- The ReleaseParameters
associated with this
(and possibly other instances of
Schedulable
). If release
is null the new
RealtimeThread
will use a clone of the default
ReleaseParameters
for the associated scheduler created in the
memory area that contains the RealtimeThread
object.memory
- The MemoryParameters
associated with this
(and possibly other instances of
Schedulable
). If memory
is null, the new
RealtimeThread
receives null value for its
memory parameters, and the amount or rate of memory allocation for
the new thread is unrestricted.area
- The MemoryArea
associated with this
.
If area
is null, the initial memory area of
the new RealtimeThread
is the current memory area at the time the constructor is called.group
- The ProcessingGroupParameters
associated with this
(and possibly other instances of Schedulable
).
If null, the new RealtimeThread
will not be
associated with any processing group.logic
- The Runnable
object whose run()
method
will serve as the logic for the new RealtimeThread
.
If logic
is null, the run()
method in the
new object will serve as its logic.
java.lang.IllegalArgumentException
- Thrown if the parameters
are not compatible with the associated scheduler.
IllegalAssignmentError
- Thrown if the new RealtimeThread
instance
cannot hold a reference to non-null values of scheduling
release
memory
and group
, or if
those parameters cannot hold a reference to the new RealtimeThread
.
Also thrown if the new RealtimeThread
instance
cannot hold a reference to non-null values of area
or logic
.Method Detail |
---|
public static RealtimeThread currentRealtimeThread()
RealtimeThread
.
It is permissible to call currentRealtimeThread
when control
is in an AsyncEventHandler
. The method will return a reference to the
RealtimeThread
supporting that release of the async event handler.
RealtimeThread
.
java.lang.ClassCastException
- Thrown if the current execution context is that of a
Java thread.public static MemoryArea getCurrentMemoryArea()
MemoryArea
object representing the
current allocation context.
If this method is invoked from a Java thread it will return that thread's current memory area (heap or immortal.)
MemoryArea
object representing the
current allocation context.public static int getInitialMemoryAreaIndex()
RealtimeThread
or
AsyncEventHandler
is the memory area given as a parameter to
its constructor. The index in the initial memory area stack of the
initial memory area is a fixed property of the real-time thread.
If the current memory area stack of the current real-time thread
is not the original stack and the memory area at the initial
memory area index is not the initial memory area,
then IllegalStateException
is thrown.
RealtimeThread
.
java.lang.IllegalStateException
- Thrown if the memory area at the initial memory
area index, in the current scope stack is not the initial memory area.
java.lang.ClassCastException
- Thrown if the current execution context is
that of a Java thread.public static int getMemoryAreaStackDepth()
MemoryArea
instances to
which the current schedulable object has access.
Note: The current memory area (getCurrentMemoryArea()
) is
found at memory area stack index getMemoryAreaStackDepth() - 1.
MemoryArea
instances.
java.lang.ClassCastException
- Thrown if the current execution context is
that of a Java thread.public static MemoryArea getOuterMemoryArea(int index)
MemoryArea
in the memory area stack
at the index given. If the given index does not exist in the
memory area scope stack then null is returned.
Note: The current memory area (getCurrentMemoryArea()
) is
found at memory area stack index getMemoryAreaStackDepth() - 1.
, so
getCurrentMemoryArea() == getOutMemoryArea(getMemoryAreaStackDepth() - 1)
.
index
- The offset into the memory area stack.
MemoryArea
at index or null
if the given value is does not correspond to a position
in the stack.
java.lang.ClassCastException
- Thrown if the current execution context is
that of a Java thread.public static void sleep(Clock clock, HighResolutionTime time) throws java.lang.InterruptedException
HighResolutionTime
, this method is an
accurate timer with nanosecond
granularity. The actual
resolution available for the clock and even the quantity it measures
depends on clock
. The time base is the given Clock
.
The sleep time may be relative or absolute. If relative, then the
calling thread is blocked for the amount of time given by time
, and
measured by clock
.
If absolute, then the calling thread is blocked until the indicated
value is reached by clock
.
If the given absolute time is less than or equal to
the current value of clock
,
the call to sleep returns immediately.
It is permissible to call sleep
when control
is in an AsyncEventHandler
. The method cause the handler to sleep.
This method must not throw IllegalAssignmentError
. It must
tolerate time
instances that may not be stored in this
.
clock
- The instance of Clock
used as the base. If clock
is null the real-time clock
(see Clock.getRealtimeClock()
) is used. If time
uses a time-base other than clock
, time
is reassociated
with clock
for purposes of this method.time
- The amount of time to sleep or the point in time at which to awaken.
java.lang.InterruptedException
- Thrown if the thread is interrupted
by interrupt()
or AsynchronouslyInterruptedException.fire()
during
the time between calling this method and returning from it.
java.lang.ClassCastException
- Thrown if the current execution context is
that of a Java thread.
java.lang.UnsupportedOperationException
- Thrown if the
sleep operation is not supported
by clock
.
java.lang.IllegalArgumentException
- Thrown if time
is null,
or if time
is a relative time less than zero.public static void sleep(HighResolutionTime time) throws java.lang.InterruptedException
HighResolutionTime
, this method is an
accurate timer with nanosecond
granularity. The actual
resolution available for the timer and even the quantity it measures
depends on the clock associated with time
.
The sleep time may be relative or absolute. If relative, then the
calling thread is blocked for the amount of time given by time
, and
measured by the clock associated with time
.
If absolute, then the calling thread is blocked until the indicated
value is reached by the associated clock.
If the given absolute time is less than or equal to
the current value of the clock,
the call to sleep returns immediately.
It is permissible to call sleep
when control
is in an AsyncEventHandler
. The method cause the handler to sleep.
This method must not throw IllegalAssignmentError
. It must
tolerate time
instances that may not be stored in this
.
time
- The amount of time to sleep or the point in time at which to awaken.
java.lang.InterruptedException
- Thrown if the thread is interrupted
by interrupt()
or AsynchronouslyInterruptedException.fire()
during
the time between calling this method and returning from it.
java.lang.ClassCastException
- Thrown if the current execution context is
that of a Java thread.
java.lang.UnsupportedOperationException
- Thrown if the
sleep operation is not supported
using the clock associated with time
.
java.lang.IllegalArgumentException
- Thrown if time
is null,
or if time
is a relative time less than zero.public static boolean waitForNextPeriod()
ReleaseParameters
type of PeriodicParameters
to block until the start of each period. The first period starts when this
thread is first released. Each time it is called this
method will block until the start of the next period unless the thread
is in a deadline miss condition. In that
case the operation of waitForNextPeriod
is controlled
by this thread's scheduler.
(See Priority Scheduler.)
java.lang.IllegalThreadStateException
- Thrown if
this
does not have a reference to a ReleaseParameters
type of PeriodicParameters
.
java.lang.ClassCastException
- Thrown if the current thread is not an
instance of RealtimeThread
.public static boolean waitForNextPeriodInterruptible() throws java.lang.InterruptedException
waitForNextPeriodInterruptible()
method is a
duplicate of waitForNextPeriod()
except that
waitForNextPeriodInterruptible
is able to throw
InterruptedException
.
Used by threads that have a reference to a ReleaseParameters
type of PeriodicParameters
to block until the start of each period. The first period starts when this
thread is first released. Each time it is called this
method will block until the start of the next period unless the thread
is in a deadline miss condition. In that
case the operation of waitForNextPeriodInterruptible
is controlled
by this thread's scheduler.
(See Priority Scheduler.)
java.lang.InterruptedException
- Thrown if the thread is interrupted
by interrupt()
or AsynchronouslyInterruptedException.fire()
during
the time between calling this method and returning from it.
An interrupt during waitForNextPeriodInterruptible
is
treated as a release for purposes of scheduling. This is likely to
disrupt proper operation of the periodic thread. The periodic behavior
of the thread is unspecified until the state is reset by altering the
thread's periodic parameters.
java.lang.ClassCastException
- Thrown if the current thread is not an
instance of RealtimeThread
.
java.lang.IllegalThreadStateException
- Thrown if
this
does not have a reference to a ReleaseParameters
type of PeriodicParameters
.public boolean addIfFeasible()
this
added to the system. If the resulting system is feasible,
inform the scheduler and cooperating facilities that this
instance of Schedulable
should be considered in
feasibility analysis until further notified. If the analysis showed that the system
including this
would not be feasible, this method does not admit
this
to the feasibility set.
If the object is already included in the feasibility set, do nothing.
addIfFeasible
in interface Schedulable
this
in the feasibility set yields a
feasible system, and false otherwise. If true is returned then
this
is
known to be in the feasibility set. If false is returned
this
was not added to the feasibility set, but may
already have been present.public boolean addToFeasibility()
Schedulable
should be considered in
feasibility analysis until further notified.
If the object is already included in the feasibility set, do nothing.
addToFeasibility
in interface Schedulable
public void deschedulePeriodic()
ReleaseParameters
object associated with this
RealtimeThread
is an instance of
is PeriodicParameters
, perform any deschedulePeriodic
actions specified by
this thread's scheduler.
If the
type of the associated instance of ReleaseParameters
is not
PeriodicParameters
nothing happens.
public MemoryArea getMemoryArea()
RealtimeThread
(corresponding to the
area
parameter for the constructor.)
Note: Unlike the scheduling-related parameter objects, there is never
a case where a default parameter will be constructed for the thread. The default
is a reference to the current allocation context when this
is constructed.
public MemoryParameters getMemoryParameters()
MemoryParameters
object for this
schedulable object.
getMemoryParameters
in interface Schedulable
MemoryParameters
object.public ProcessingGroupParameters getProcessingGroupParameters()
ProcessingGroupParameters
object for this
schedulable object.
getProcessingGroupParameters
in interface Schedulable
ProcessingGroupParameters
object.public ReleaseParameters getReleaseParameters()
ReleaseParameters
object for this
schedulable object.
getReleaseParameters
in interface Schedulable
ReleaseParameters
object.public Scheduler getScheduler()
Scheduler
object for this
schedulable object.
getScheduler
in interface Schedulable
Scheduler
object.public SchedulingParameters getSchedulingParameters()
SchedulingParameters
object for this
schedulable object.
getSchedulingParameters
in interface Schedulable
SchedulingParameters
object.public void interrupt()
Thread.interrupt()
,
generates the generic AsynchronouslyInterruptedException and
targets it at this, and sets the interrupted state to pending.
(See AsynchronouslyInterruptedException
.
The semantics of Thread.interrupt()
are preserved.
interrupt
in class java.lang.Thread
public boolean removeFromFeasibility()
Schedulable
should not be considered in
feasibility analysis until it is further notified.
removeFromFeasibility
in interface Schedulable
public void schedulePeriodic()
waitForNextPeriod()
for a periodic thread. If
deadline miss detection is disabled, enable it.
Typically used when a periodic schedulable object is in a
deadline miss condition.
The details of the interaction of this method with deschedulePeriodic()
and
waitForNextPeriod()
are dictated by this thread's scheduler.
If this RealtimeThread
does not have a type of PeriodicParameters
as its ReleaseParameters
nothing happens.
public boolean setIfFeasible(ReleaseParameters release, MemoryParameters memory)
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
This method does not require that the schedulable object be in the feasibility set before it is called. If it is not initially a member of the feasibility set it will be added if the resulting system is feasible.
setIfFeasible
in interface Schedulable
release
- The proposed release parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)memory
- The proposed memory parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when the parameter values are not compatible
with the schedulable object's scheduler.
Also thrown if this schedulable object is no-heap and any of the proposed parameter objects
are located in heap memory.
IllegalAssignmentError
- Thrown if this cannot hold references to the
proposed parameter objects, or the parameter objects cannot hold a reference to this.
java.lang.IllegalThreadStateException
- Thrown if the new release parameters change
the schedulable object from periodic scheduling to some other protocol and the
schedulable object is currently waiting for the next release
in waitForNextPeriod()
or
waitForNextPeriodInterruptible()
.public boolean setIfFeasible(ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
This method does not require that the schedulable object be in the feasibility set before it is called. If it is not initially a member of the feasibility set it will be added if the resulting system is feasible.
setIfFeasible
in interface Schedulable
release
- The proposed release parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)memory
- The proposed memory parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)group
- The proposed processing group parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when the parameter values are not compatible
with the schedulable object's scheduler.
Also thrown if this schedulable object is no-heap and any of the proposed parameter objects
are located in heap memory.
IllegalAssignmentError
- Thrown if this cannot hold references to the
proposed parameter objects, or the parameter objects cannot hold a reference to this.
java.lang.IllegalThreadStateException
- Thrown if the new release parameters change
the schedulable object from periodic scheduling to some other protocol and the
schedulable object is currently waiting for the next release
in waitForNextPeriod()
or
waitForNextPeriodInterruptible()
.public boolean setIfFeasible(ReleaseParameters release, ProcessingGroupParameters group)
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
This method does not require that the schedulable object be in the feasibility set before it is called. If it is not initially a member of the feasibility set it will be added if the resulting system is feasible.
setIfFeasible
in interface Schedulable
release
- The proposed release parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)group
- The proposed processing group parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when the parameter values are not compatible
with the schedulable object's scheduler.
Also thrown if this schedulable object is no-heap and any of the proposed parameter objects
are located in heap memory.
IllegalAssignmentError
- Thrown if this cannot hold references to the
proposed parameter objects, or the parameter objects cannot hold a reference to this.
java.lang.IllegalThreadStateException
- Thrown if the new release parameters change
the schedulable object from periodic scheduling to some other protocol and the
schedulable object is currently waiting for the next release
in waitForNextPeriod()
or
waitForNextPeriodInterruptible()
.public boolean setIfFeasible(SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory)
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
This method does not require that the schedulable object be in the feasibility set before it is called. If it is not initially a member of the feasibility set it will be added if the resulting system is feasible.
setIfFeasible
in interface Schedulable
scheduling
- The proposed scheduling parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)release
- The proposed release parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)memory
- The proposed memory parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when the parameter values are not compatible
with the schedulable object's scheduler.
Also thrown if this schedulable object is no-heap and any of the proposed parameter objects
are located in heap memory.
IllegalAssignmentError
- Thrown if this cannot hold references to the
proposed parameter objects, or the parameter objects cannot hold a reference to this.
java.lang.IllegalThreadStateException
- Thrown if the new release parameters change
the schedulable object from periodic scheduling to some other protocol and the
schedulable object is currently waiting for the next release
in waitForNextPeriod()
or
waitForNextPeriodInterruptible()
.public boolean setIfFeasible(SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
This method does not require that the schedulable object be in the feasibility set before it is called. If it is not initially a member of the feasibility set it will be added if the resulting system is feasible.
setIfFeasible
in interface Schedulable
scheduling
- The proposed scheduling parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)release
- The proposed release parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)memory
- The proposed memory parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)group
- The proposed processing group parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when the parameter values are not compatible
with the schedulable object's scheduler.
Also thrown if this schedulable object is no-heap and any of the proposed parameter objects
are located in heap memory.
IllegalAssignmentError
- Thrown if this cannot hold references to the
proposed parameter objects, or the parameter objects cannot hold a reference to this.
java.lang.IllegalThreadStateException
- Thrown if the new release parameters change
the schedulable object from periodic scheduling to some other protocol and the
schedulable object is currently waiting for the next release
in waitForNextPeriod()
or
waitForNextPeriodInterruptible()
.public void setMemoryParameters(MemoryParameters memory)
Schedulable
.
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
Since this affects the constraints expressed in the memory parameters of the existing schedulable objects, this may change the feasibility of the current system.
setMemoryParameters
in interface Schedulable
memory
- A MemoryParameters
object which will become the memory parameters
associated with this
after the method call.
If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown if memory
is not compatible with the schedulable object's scheduler.
Also thrown if this schedulable object is no-heap and
memory
is located in heap memory.
IllegalAssignmentError
- Thrown if the schedulable object
cannot hold a reference to memory
, or if
memory
cannot hold a reference to
this schedulable object instance.public boolean setMemoryParametersIfFeasible(MemoryParameters memory)
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
This method does not require that the schedulable object be in the feasibility set before it is called. If it is not initially a member of the feasibility set it will be added if the resulting system is feasible.
setMemoryParametersIfFeasible
in interface Schedulable
memory
- The proposed memory parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when the parameter value is not compatible
with the schedulable object's scheduler.
Also thrown if this schedulable object is no-heap and the proposed parameter object
is located in heap memory.
IllegalAssignmentError
- Thrown if this cannot hold a reference to the
proposed parameter object, or the parameter object cannot hold a reference to this.public void setProcessingGroupParameters(ProcessingGroupParameters group)
ProcessingGroupParameters
of this
.
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
Since this affects the constraints expressed in the processing group parameters of the existing schedulable objects, this may change the feasibility of the current system.
setProcessingGroupParameters
in interface Schedulable
group
- A ProcessingGroupParameters
object which will take
effect as determined by the associated scheduler.
If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when group
is not compatible with the scheduler for this schedulable object.
Also thrown if this schedulable object is no-heap and
group
is located in heap memory.
IllegalAssignmentError
- Thrown if this
object
cannot hold a reference to group
or
group
cannot hold a reference to this
.public boolean setProcessingGroupParametersIfFeasible(ProcessingGroupParameters group)
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
This method does not require that the schedulable object be in the feasibility set before it is called. If it is not initially a member of the feasibility set it will be added if the resulting system is feasible.
setProcessingGroupParametersIfFeasible
in interface Schedulable
group
- The proposed processing group parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when the parameter value is not compatible
with the schedulable object's scheduler.
Also thrown if this schedulable object is no-heap and the proposed parameter object
is located in heap memory.
IllegalAssignmentError
- Thrown if this cannot hold a reference to the
proposed parameter object, or the parameter object cannot hold a reference to this.public void setReleaseParameters(ReleaseParameters release)
Schedulable
.
Since this affects the constraints expressed in the release parameters of the existing schedulable objects, this may change the feasibility of the current system.
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. The different properties of the release parameters may take effect at different times. See the documentation for the scheduler for details.
setReleaseParameters
in interface Schedulable
release
- A ReleaseParameters
object which will become the release parameters
associated with this after the method call, and take effect as
determined by the associated scheduler.
If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when release
is not compatible with the associated scheduler.
Also thrown if this schedulable object is no-heap and
release
is located in heap memory.
IllegalAssignmentError
- Thrown if this
object
cannot hold a reference to release
or
release
cannot hold a reference to this
.
java.lang.IllegalThreadStateException
- Thrown if the new release parameters change
the schedulable object from periodic scheduling to some other protocol and the
schedulable object is currently
waiting for the next release
in waitForNextPeriod()
or waitForNextPeriodInterruptible()
.public boolean setReleaseParametersIfFeasible(ReleaseParameters release)
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
This method does not require that the schedulable object be in the feasibility set before it is called. If it is not initially a member of the feasibility set it will be added if the resulting system is feasible.
setReleaseParametersIfFeasible
in interface Schedulable
release
- The proposed release parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when the parameter value is not compatible
with the schedulable object's scheduler.
Also thrown if this schedulable object is no-heap and the proposed parameter object
is located in heap memory.
IllegalAssignmentError
- Thrown if this cannot hold a reference to the
proposed parameter object, or the parameter object cannot hold a reference to this.
java.lang.IllegalThreadStateException
- Thrown if the new release parameters change
the schedulable object from periodic scheduling to some other protocol and the
schedulable object is currently waiting for the next release
in waitForNextPeriod()
or
waitForNextPeriodInterruptible()
.public void setScheduler(Scheduler scheduler)
scheduler
.
setScheduler
in interface Schedulable
scheduler
- A reference to the scheduler that will manage
execution of this schedulable object. Null
is not a
permissible value.
java.lang.IllegalArgumentException
- Thrown when scheduler
is null, or the schedulable object's existing
parameter values are not compatible with scheduler
.
Also thrown if this schedulable object is no-heap and
scheduler
is located in heap memory.
IllegalAssignmentError
- Thrown if the schedulable object
cannot hold a reference to scheduler
.
java.lang.SecurityException
- Thrown if the caller is not permitted to set the scheduler for this
schedulable object.public void setScheduler(Scheduler scheduler, SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memoryParameters, ProcessingGroupParameters group)
scheduler
.
setScheduler
in interface Schedulable
scheduler
- A reference to the scheduler that will manage the execution of this
schedulable object.
Null is not a permissible value.scheduling
- A reference to the SchedulingParameters
which will be associated with this
.
If null,
the default value is governed by scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)release
- A reference to the ReleaseParameters
which will be associated with this
.
If null,
the default value is governed by scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)memoryParameters
- A reference to the MemoryParameters
which
will be associated with this
.
If null,
the default value is governed by scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)group
- A reference to the ProcessingGroupParameters
which
will be associated with this
.
If null,
the default value is governed by scheduler
(a new object is created). (See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when scheduler
is null or the
parameter values are not compatible with scheduler
.
Also thrown when this schedulable object is no-heap and
scheduler
, scheduling
release
, memoryParameters
,
or group
is located in heap memory.
IllegalAssignmentError
- Thrown if this
object
cannot hold references to all the parameter objects or
the parameters cannot hold references to this
.
java.lang.IllegalThreadStateException
- Thrown if the new release parameters change
the schedulable object from periodic scheduling to some other protocol and the
schedulable object is currently
waiting for the next release
in waitForNextPeriod()
or waitForNextPeriodInterruptible()
.
java.lang.SecurityException
- Thrown if the caller is not permitted to set the scheduler for this
schedulable object.public void setSchedulingParameters(SchedulingParameters scheduling)
Schedulable
.
Since this affects the scheduling parameters of the existing schedulable objects, this may change the feasibility of the current system.
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
setSchedulingParameters
in interface Schedulable
scheduling
- A reference to the SchedulingParameters
object.
If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when scheduling
is not compatible with the associated scheduler.
Also thrown if this schedulable object is no-heap and
scheduling
is located in heap memory.
IllegalAssignmentError
- Thrown if this
object
cannot hold a reference to scheduling
or
scheduling
cannot hold a reference to this
.public boolean setSchedulingParametersIfFeasible(SchedulingParameters scheduling)
This change becomes effective under conditions determined by the scheduler controlling the schedulable object. For instance, the change may be immediate or it may be delayed until the next release of the schedulable object. See the documentation for the scheduler for details.
This method does not require that the schedulable object be in the feasibility set before it is called. If it is not initially a member of the feasibility set it will be added if the resulting system is feasible.
setSchedulingParametersIfFeasible
in interface Schedulable
scheduling
- The proposed scheduling parameters. If null,
the default value is governed by the associated scheduler
(a new object is created if the default value is not null).
(See PriorityScheduler
.)
java.lang.IllegalArgumentException
- Thrown when the parameter value is not compatible
with the schedulable object's scheduler.
Also thrown if this schedulable object is no-heap and the proposed parameter object
is located in heap memory.
IllegalAssignmentError
- Thrown if this cannot hold a reference to the
proposed parameter object, or the parameter object cannot hold a reference to this.public void start()
ScopedMemory
.)
start
in class java.lang.Thread