org.objectweb.proactive.scheduler
Class Scheduler

java.lang.Object
  extended by org.objectweb.proactive.scheduler.Scheduler
All Implemented Interfaces:
java.io.Serializable, SchedulerConstants

public class Scheduler
extends java.lang.Object
implements java.io.Serializable, SchedulerConstants

This is the class of the scheduler daemon.

Author:
cjarjouh
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.objectweb.proactive.scheduler.SchedulerConstants
JOB_ID, JVM_PARAMETERS, POLICY_NAME, SCHEDULER_NODE_NAME, SCHEDULER_URL, XML_PATH
 
Constructor Summary
Scheduler()
           
Scheduler(java.lang.String policyClass)
          Scheduler constructor that instanciate an active object used to manage jobs knowing the policy class name and creates an active object ressource manager.
 
Method Summary
 void commit(java.lang.String jobID)
          commits the job's description and submits it to the waiting queue
static Scheduler connectTo(java.lang.String schedulerURL)
          connects to the scheduler node and fetchs the scheduler daemon using the submitted url
static void createScheduler(java.lang.String policyName)
          This method is used to create a unique scheduler object on the machine.
 BooleanWrapper del(java.lang.String jobId)
          Deletes the job from the queue and stops it if it has already been launched.
 void end()
          Method invoqued when we want to shutdown the scheduler.
 StringMutableWrapper fetchJobDescription(java.lang.String xmlDescriptorUrl)
          This method launches the parsing of the XML file to extract the description of the job submitted prior to its submission to the queue.
protected  void finalize()
          Redefines the finalize method to do some cleaning.
 java.util.Vector getNodes(int ressourceNb, int estimatedTime)
          This method is used while programming ..
 Node[] getReservedNodes(java.lang.String jobID, int askedNodes)
          returns an array of the reserved nodes of the object with the specified jobId
 GenericJob getTmpJob(java.lang.String jobID)
          Gets the temporary created generic job object to change it's attribute's content.
 StringMutableWrapper info()
          Gives intormation about the scheduler.
 void init()
           
static void main(java.lang.String[] args)
           
 java.util.Vector nodes(java.lang.String nodeURL)
          Provides the information about the nodes (state, job running, ...)
static void start(java.lang.String policyName)
          Starts the scheduler.
 java.util.Vector stat(java.lang.String jobId)
          Gives description of all the jobs that are curently running in forms of a Vector if no specific id is specified, else, it gives the description of the specified job if it exists.
 BooleanWrapper sub(GenericJob job)
          Insert a job in the queue of the scheduler.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scheduler

public Scheduler()

Scheduler

public Scheduler(java.lang.String policyClass)
Scheduler constructor that instanciate an active object used to manage jobs knowing the policy class name and creates an active object ressource manager.

Parameters:
policyClass, - the class name of the policy
Method Detail

init

public void init()

sub

public BooleanWrapper sub(GenericJob job)
Insert a job in the queue of the scheduler.

Parameters:
job, - the descriptions of the job to be inserted
Returns:
true if the queue is not full and false for the other way around.

del

public BooleanWrapper del(java.lang.String jobId)
Deletes the job from the queue and stops it if it has already been launched.

Parameters:
id: - the id of the job
Returns:
true if the operation completed succesfully, false orherwise.

stat

public java.util.Vector stat(java.lang.String jobId)
Gives description of all the jobs that are curently running in forms of a Vector if no specific id is specified, else, it gives the description of the specified job if it exists.

Returns:
an ArrayList containing the description of all the running jobs.

nodes

public java.util.Vector nodes(java.lang.String nodeURL)
Provides the information about the nodes (state, job running, ...)

Returns:
information about the nodes in forms of an ArrayList and null if the node is not defined

createScheduler

public static void createScheduler(java.lang.String policyName)
This method is used to create a unique scheduler object on the machine. If the scheduler isn't already created, it creates a new instance.

Parameters:
policyName - the name of the policy used by the scheduler
Throws:
java.lang.Exception - when having difficulty with the creation of the scheduler.

start

public static void start(java.lang.String policyName)
Starts the scheduler.


end

public void end()
Method invoqued when we want to shutdown the scheduler. We can free the ressources here for example ...


info

public StringMutableWrapper info()
Gives intormation about the scheduler. (Version ...)


finalize

protected void finalize()
Redefines the finalize method to do some cleaning.

Overrides:
finalize in class java.lang.Object

fetchJobDescription

public StringMutableWrapper fetchJobDescription(java.lang.String xmlDescriptorUrl)
This method launches the parsing of the XML file to extract the description of the job submitted prior to its submission to the queue.

Returns:
the jobId of the newly created object

connectTo

public static Scheduler connectTo(java.lang.String schedulerURL)
connects to the scheduler node and fetchs the scheduler daemon using the submitted url

Parameters:
schedulerURL - the url of the scheduler node
Returns:
the scheduler object

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getNodes

public java.util.Vector getNodes(int ressourceNb,
                                 int estimatedTime)
This method is used while programming .. You can use it to reserve submit your demand for ressources...


getReservedNodes

public Node[] getReservedNodes(java.lang.String jobID,
                               int askedNodes)
returns an array of the reserved nodes of the object with the specified jobId


commit

public void commit(java.lang.String jobID)
commits the job's description and submits it to the waiting queue

Parameters:
jobID - the ID of the job

getTmpJob

public GenericJob getTmpJob(java.lang.String jobID)
Gets the temporary created generic job object to change it's attribute's content. It is important to note that this method is only used while parsing.

Parameters:
jobID - the job id of the temporary job description object.
Returns:
the temporary object or null if the object oesn't exist.


Copyright 2001-2007 INRIA All Rights Reserved.