public class PriorityParameters extends SchedulingParameters implements Cloneable
The default scheduler, PriorityScheduler, uses the priority value provided in the PriorityParameters associated to a schedulable object to determine the execution eligibility.
If two schedulable objects with different current priority values are ready to run, the schedulable object with the higher current priority will always be executed in precedence to the one with lower actual priority.
The current priority is equal to the base priority if no priority inversion avoidance mechanism has increased the priority to a higher value.
Constructor and Description |
---|
PriorityParameters(int priority)
Constructor to create instance of PriorityParameters with the
given initial priority value.
|
PriorityParameters(int priority,
Affinity affinity)
Creates an instance of
PriorityParameters with the given features. |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
clone creates a clone of this object with the same parameters but
without association to any schedulable object
|
int |
getPriority()
getPriority returns the current priority value
|
PriorityParameters |
setPriority(int priority)
setPriority changes the priority value of this and the current
base priority of all schedulable objects that are associated with
this.
|
boolean |
subsumes(SchedulingParameters other)
Indicates that some set represented by
other is subsumed by the
set represented by this object. |
String |
toString()
toString creates a string of the form
"PriorityParameters(" + priority + ")" |
getAffinity
public PriorityParameters(int priority)
priority
- the initial priority value.public PriorityParameters(int priority, Affinity affinity)
PriorityParameters
with the given features.priority
- The priority assigned to schedulables that use this
parameter instance.affinity
- The affinity assigned to schedulables that use this
parameter instance.public int getPriority()
public PriorityParameters setPriority(int priority) throws StaticIllegalArgumentException
StaticIllegalArgumentException
- when priority is not applicable
to any scheduler of the associated schedulable objectspriority
- the new priority value.public boolean subsumes(SchedulingParameters other)
Subsumable
other
is subsumed by the
set represented by this
object.subsumes
in interface Subsumable<SchedulingParameters>
subsumes
in class SchedulingParameters
other
- The object to be compared with.other
is
subsumed by the set represented by this
object.public String toString()
"PriorityParameters(" + priority + ")"
public Object clone()
clone
in class SchedulingParameters
Cloneable
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2022 aicas GmbH. All Rights Reserved.