public abstract class AbstractScheduler extends PropertyResources implements Scheduling, Initializable
Scheduling interface. Provided are
methods for loading a target list and for registering a set of globals. A
constructor using a single Map object as argument is provided.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private Collection<Appointable.Constraint> |
global
The collection of global constraints currently assigned.
|
private Object |
sleeper
Notify this object if asked to.
|
KEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Modifier | Constructor and Description |
|---|---|
protected |
AbstractScheduler(Map<String,String> sprop)
Protected constructer defining this schedulers properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGlobalConstraint(Appointable.Constraint cons)
Adds a global constraint to the scheduler.
|
protected boolean |
checkGlobalConstraints(GlobalGrouping set,
Appointable target)
Checks, if the target is observable under all global constraints.
|
static Scheduling |
createScheduler(Map<String,String> prop)
Constructs a new scheduling instance using the mapping of the
PropertySupplying.KEY_CLASS to the class name to derive the class to instantiate. |
Collection<Appointable.Constraint> |
getGlobalConstraints()
Returns a collection of all currently registered global constraints.
|
Collection<Appointable> |
getObservableTargets(GlobalGrouping set,
Collection<Appointable> targets)
Shortens the list of targets to all targets that are currently
observable.
|
void |
init() |
Object |
registerMonitor(Object waiter)
Registers an object for notification.
|
void |
removeAllGlobalConstraints()
Removes all global constraints.
|
void |
removeGlobalConstraint(Appointable.Constraint cons)
Removes a global constraint from the scheduler.
|
protected void |
wakeUp()
Notifies the sleeping object if it is set.
|
clone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, parseObject, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHighestTargetdefaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringPropertiesprivate Collection<Appointable.Constraint> global
private Object sleeper
public void init()
init in interface Initializablepublic void addGlobalConstraint(Appointable.Constraint cons)
addGlobalConstraint in interface Schedulingpublic void removeGlobalConstraint(Appointable.Constraint cons)
removeGlobalConstraint in interface Schedulingpublic void removeAllGlobalConstraints()
removeAllGlobalConstraints in interface Schedulingpublic Collection<Appointable.Constraint> getGlobalConstraints()
getGlobalConstraints in interface Schedulingpublic Object registerMonitor(Object waiter)
wakeUp() is
called after an object has been registered the argumental objects is
notified of any change happened to the sequencer. Due to the
synchronizing behaviour of the wakeUp() method, care must
be taken to avoid dead-lock.registerMonitor in interface Schedulingpublic Collection<Appointable> getObservableTargets(GlobalGrouping set, Collection<Appointable> targets)
getObservableTargets in interface Schedulingprotected boolean checkGlobalConstraints(GlobalGrouping set, Appointable target)
protected void wakeUp()
public static final Scheduling createScheduler(Map<String,String> prop)
PropertySupplying.KEY_CLASS to the class name to derive the class to instantiate.
If this property is defined, a new Scheduling instance with the stated
class name is created, the supplied properties used as an argument in the
constructor. Can throw a lot of exceptions if unsuccessful.