public interface Schedulable extends java.lang.Runnable, Subsumable<Schedulable>
Schedulable can be scheduled by any
Scheduler defined here. A scheduler uses the information available
through this interface to create a suitable context in which to execute
the code encapsulated by this object.| Modifier and Type | Method and Description |
|---|---|
default boolean |
addToFeasibility()
Deprecated.
as of RTSJ 2.0 The framework for feasibility analysis
is inadequate.
|
ConfigurationParameters |
getConfigurationParameters()
Gets a reference to the
ConfigurationParameters
object for this schedulable. |
MemoryParameters |
getMemoryParameters()
Gets a reference to the
MemoryParameters object for this
schedulable. |
default ProcessingGroupParameters |
getProcessingGroupParameters()
Deprecated.
since RTSJ 2.0
|
ReleaseParameters<?> |
getReleaseParameters()
Gets a reference to the
ReleaseParameters object for this
schedulable. |
Scheduler |
getScheduler()
Gets a reference to the
Scheduler object for this
schedulable. |
SchedulingParameters |
getSchedulingParameters()
Gets a reference to the
SchedulingParameters object for this
schedulable. |
boolean |
isDaemon()
Tests if this event handler is a daemon handler.
|
boolean |
mayUseHeap()
Determines whether or not this
schedulable may use the heap. |
default boolean |
removeFromFeasibility()
Deprecated.
as of RTSJ 2.0 The framework for feasibility analysis is
inadequate
|
void |
setDaemon(boolean on)
Marks this schedulable as either a daemon or a user task.
|
Schedulable |
setMemoryParameters(MemoryParameters memory)
Sets the memory parameters associated with this instance of
Schedulable. |
default void |
setProcessingGroupParameters(ProcessingGroupParameters group)
Deprecated.
since RTSJ 2.0;
see
ProcessingConstraint. |
Schedulable |
setReleaseParameters(ReleaseParameters<?> release)
Sets the release parameters associated with this instance of
Schedulable. |
Schedulable |
setScheduler(Scheduler scheduler)
Sets the reference to the Scheduler object.
|
Schedulable |
setScheduler(Scheduler scheduler,
SchedulingParameters scheduling,
ReleaseParameters<?> release,
MemoryParameters memoryParameters)
Sets the scheduler and associated parameter objects.
|
Schedulable |
setSchedulingParameters(SchedulingParameters scheduling)
Sets the scheduling parameters associated with this instance of
Schedulable. |
boolean |
subsumes(Schedulable other)
Determine whether or not this instance of
Schedulable is
more eligible than other. |
MemoryParameters getMemoryParameters()
MemoryParameters object for this
schedulable.MemoryParameters object.Schedulable setMemoryParameters(MemoryParameters memory)
Schedulable.
This change becomes effective at the next allocation; on multiprocessor systems, there may be some delay due to synchronization between processors.
memory - A MemoryParameters object which will become
the memory parameters associated with
this after the method call. When
null, the default value is governed by
the associated scheduler; a new object is created when
the default value is not null. (See
PriorityScheduler.)thisStaticIllegalArgumentException - when memory is not
compatible with the schedulable's scheduler. Also
when this schedulable may not use the heap and
memory is located in heap memory.IllegalAssignmentError - when the schedulable cannot
hold a reference to memory, or when
memory cannot hold a reference to this
schedulable instance.ReleaseParameters<?> getReleaseParameters()
ReleaseParameters object for this
schedulable.ReleaseParameters object.Schedulable setReleaseParameters(ReleaseParameters<?> release)
Schedulable.
This change becomes effective under conditions determined by the scheduler controlling the schedulable. For instance, the change may be immediate or it may be delayed until the next release of the schedulable. The different properties of the release parameters may take effect at different times. See the documentation for the scheduler for details.
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. When null, the default value is
governed by the associated scheduler; a new object is
created when the default value is not null.
(See PriorityScheduler.)thisStaticIllegalArgumentException - when release
is not compatible with the associated scheduler. Also when
this schedulable may not use the heap and release
is located in heap memory.IllegalAssignmentError - when this object cannot
hold a reference to release or
release cannot hold a reference to
this.IllegalTaskStateException - when the task is running and
the new release parameters are not compatible with the current
scheduler.Scheduler getScheduler()
Scheduler object for this
schedulable.Scheduler object.Schedulable setScheduler(Scheduler scheduler) throws StaticSecurityException, IllegalTaskStateException
scheduler. If the
Schedulable is running, its associated
SchedulingParameters (if any) must be compatible with
scheduler.scheduler - A reference to the scheduler that will manage
execution of this schedulable. Null is
not a permissible value.thisStaticIllegalArgumentException - when scheduler
is null, or the schedulable's existing
parameter values are not compatible with
scheduler. Also when this schedulable
may not use the heap and scheduler is located in heap
memory.IllegalAssignmentError - when the schedulable cannot
hold a reference to scheduler or the current
Schedulable is running and its associated
SchedulingParameters are incompatible with
scheduler.StaticSecurityException - when the caller is not permitted to set
the scheduler for this schedulable.IllegalTaskStateException - when scheduler
has scheduling or release parameters that are not compatible
with the new scheduler and this schedulable is running.Schedulable setScheduler(Scheduler scheduler, SchedulingParameters scheduling, ReleaseParameters<?> release, MemoryParameters memoryParameters)
scheduler.scheduler - A reference to the scheduler that will manage the
execution of this schedulable. Null is
not a permissible value.scheduling - A reference to the SchedulingParameters
which will be associated with this. When
null, the default value is governed by
scheduler; a new object is created when the
default value is not null. (See PriorityScheduler.)release - A reference to the ReleaseParameters which
will be associated with this. When
null, the default value is governed by
scheduler; a new object is created when the
default value is not null. (See PriorityScheduler.)memoryParameters - A reference to the MemoryParameters
which will be associated with this. When
null, the default value is governed by
scheduler; a new object is created when the default
value is not null. (See PriorityScheduler.)thisStaticIllegalArgumentException - when scheduler
is null or the parameter values are not
compatible with scheduler. Also thrown when
this schedulable may not use the heap and
scheduler, scheduling
release, memoryParameters, or
group is located in heap memory.IllegalAssignmentError - when this object cannot
hold references to all the parameter objects or the
parameters cannot hold references to this.StaticSecurityException - when the caller is not permitted to set
the scheduler for this schedulable.SchedulingParameters getSchedulingParameters()
SchedulingParameters object for this
schedulable.SchedulingParameters object.Schedulable setSchedulingParameters(SchedulingParameters scheduling) throws IllegalTaskStateException, IllegalAssignmentError, StaticIllegalArgumentException
Schedulable.
This change becomes effective under conditions determined by the scheduler controlling the schedulable. For instance, the change may be immediate or it may be delayed until the next release of the schedulable. See the documentation of the scheduler for details.
scheduling - A reference to the SchedulingParameters
object. When null, the default value is governed
by the associated scheduler; a new object is created when the
default value is not null. (See
PriorityScheduler.). When the Affinity is not defined
in scheduling, then the affinity that will be used
is the one of the creating Thread. However, this default
affinity will not appear when calling
getSchedulingParameters(), unless explicitly set using
this method.thisStaticIllegalArgumentException - when scheduling is
not compatible with the associated scheduler. Also when
this schedulable may not use the heap and
scheduling is located in heap memory.IllegalAssignmentError - when this object cannot hold
a reference to scheduling or scheduling
cannot hold a reference to this.IllegalTaskStateException - when the task is active and
the new scheduling parameters are not compatible with the current
scheduler or when the task is active and the affinity in
scheduling is not a subset of the affinity of this
object's RealtimeThreadGroup or when the task is active and
the affinity in scheduling is invalid.this.ConfigurationParameters getConfigurationParameters()
ConfigurationParameters
object for this schedulable.ConfigurationParameters object.void setDaemon(boolean on)
on - When true, marks this event handler as a daemon handler.java.lang.IllegalThreadStateException - when this schedulable is active.StaticSecurityException - when the current schedulable
cannot modify this event handler.boolean isDaemon()
true when this event handler is a daemon handler;
false otherwise.boolean mayUseHeap()
schedulable may use the heap.true only when this Schedulable may allocate
on the heap and may enter the Heap.boolean subsumes(Schedulable other)
Schedulable is
more eligible than other. On multicore systems, this only
gives a partial ordering over all schedulables. Schedulables with
disjoint processor affinity do not subsume one another.subsumes in interface Subsumable<Schedulable>other - The object to be compared with.true when and only when this instance of
Schedulable is more eligible than other.@Deprecated default ProcessingGroupParameters getProcessingGroupParameters()
ProcessingGroupParameters object
for this schedulable.ProcessingGroupParameters object.@Deprecated default void setProcessingGroupParameters(ProcessingGroupParameters group)
ProcessingConstraint.ProcessingGroupParameters of this.
This change becomes effective under conditions determined by the scheduler controlling the schedulable. For instance, the change may be immediate or it may be delayed until the next release of the schedulable. See the documentation for the scheduler for details.
group - A ProcessingGroupParameters object which will
take effect as determined by the associated scheduler. When
null, the default value is governed by the
associated scheduler (a new object is created when the default
value is not null). (See PriorityScheduler.)StaticIllegalArgumentException - when group is
not compatible with the scheduler for this schedulable
object. Also when this schedulable may not use the heap and
group is located in heap memory.IllegalAssignmentError - when this object cannot
hold a reference to group or
group cannot hold a reference to
this.java.lang.IllegalThreadStateException - when the schedulable's
scheduler prohibits the changing of the processing group
parameter at this time due to the state of the schedulable
object.@Deprecated default boolean addToFeasibility()
Schedulable should be considered in
feasibility analysis until further notified.
When the object is already included in the feasibility set, does nothing.
true, when the resulting system is feasible.
False, when not.@Deprecated default boolean removeFromFeasibility()
Schedulable should not be considered in
feasibility analysis until it is further notified.true when the removal was successful.
false when the
schedulable cannot be removed from the scheduler's
feasibility set; e.g., the schedulable is not part
of the scheduler's feasibility set.