org.globus.cog.karajan.scheduler
Interface Scheduler

All Known Implementing Classes:
AbstractScheduler, DefaultScheduler, LateBindingScheduler, StaticContactListScheduler, ThrottlingScheduler, WeightedHostScoreScheduler

public interface Scheduler


Method Summary
 void addFailureHandler(FailureHandler handler)
          Allows handling task failures at the scheduler level
 void addJobStatusListener(StatusListener l, Task task)
          Allows the addition of a status listener that will be invoked whenever the status of the given task changes.
 void addTaskHandler(TaskHandlerWrapper taskHandler)
          Makes the scheduler aware of a task handler implementation.
 void addTaskTransformer(TaskTransformer transformer)
          Adds a task transformer to this scheduler.
 Contact allocateContact()
          Attempt to allocate a host.
 Contact allocateContact(Object constraints)
           
 void cancelTask(Task task)
          Prematurely terminates a task that is either enqueued or running
 void enqueue(Task task, Object constraints)
          Adds a task to the queue.
 String[] getPropertyNames()
           
 ContactSet getResources()
          Returns the set of resources that the scheduler knows about
 List getTaskHandlers()
          Returns a list of all the task handlers that were added to the scheduler
 void releaseContact(Contact sc)
          Can be used to tell the scheduler that a previously allocated contact (using allocateContact()) is not used any more.
 void removeJobStatusListener(StatusListener l, Task task)
          Removes a status listener added using addJobStatusListener
 void setProperty(String name, Object value)
          Sets a scheduler property.
 void setResources(ContactSet resources)
          Sets the set of resources that the scheduler will use
 

Method Detail

enqueue

void enqueue(Task task,
             Object constraints)
Adds a task to the queue.

Parameters:
constraints - Can be used to specify constraints under which the task should be scheduler. While the semantics of the constraints are left to the implementation, such an implementation should be able to handle at least constraints of the type Contact.
See Also:
org.globus.karajan.util.Contact

allocateContact

Contact allocateContact()
                        throws NoFreeResourceException
Attempt to allocate a host. The returned object should be used later by the requestor as a constraint while enqueuing a task.

Throws:
NoFreeResourceException

allocateContact

Contact allocateContact(Object constraints)
                        throws NoFreeResourceException
Throws:
NoFreeResourceException

releaseContact

void releaseContact(Contact sc)
Can be used to tell the scheduler that a previously allocated contact (using allocateContact()) is not used any more.


setResources

void setResources(ContactSet resources)
Sets the set of resources that the scheduler will use

See Also:
ContactSet

getResources

ContactSet getResources()
Returns the set of resources that the scheduler knows about


addJobStatusListener

void addJobStatusListener(StatusListener l,
                          Task task)
Allows the addition of a status listener that will be invoked whenever the status of the given task changes.


removeJobStatusListener

void removeJobStatusListener(StatusListener l,
                             Task task)
Removes a status listener added using addJobStatusListener


addTaskHandler

void addTaskHandler(TaskHandlerWrapper taskHandler)
Makes the scheduler aware of a task handler implementation. The scheduler can then make use of any of the task handlers that were added.

See Also:
TaskHandlerWrapper

getTaskHandlers

List getTaskHandlers()
Returns a list of all the task handlers that were added to the scheduler


setProperty

void setProperty(String name,
                 Object value)
Sets a scheduler property. The supported property names can be queried using the getPropertyNames method


getPropertyNames

String[] getPropertyNames()

cancelTask

void cancelTask(Task task)
Prematurely terminates a task that is either enqueued or running


addTaskTransformer

void addTaskTransformer(TaskTransformer transformer)
Adds a task transformer to this scheduler. A task transformer allows modifying of various task parameters after the task has been fully resolved.


addFailureHandler

void addFailureHandler(FailureHandler handler)
Allows handling task failures at the scheduler level