os
Class OSScheduler

java.lang.Object
  |
  +--os.OSScheduler

public class OSScheduler
extends java.lang.Object

Implements a round-robin scheduler for the Bot Operating System. Each process is allowed to run as long as it wants until it throws an OSProcessDone, OSProcessExec, OSProcessLoadProcess, OSProcessRelinquishControl, or OSProcessWaitForProcess exception. At that point the process is removed from the run queue, and for all but OSProcessDone, and OSProcessExec, put back at the bottom of the run queue to run again later. When OSProcessDone is thrown the processes done method is called.

Version:
1.1
Author:
Thaddeus O. Cooper (cooper@tweenproject.org)

Constructor Summary
OSScheduler()
          Creates an empty scheduler with no initialization path or initialization process name.
OSScheduler(java.lang.String initPath)
          Creates a scheduler with the specified initialization path.
OSScheduler(java.lang.String initPath, java.lang.String initProcessName)
          Creates a scheduler with the specified initialization path and initialization process name.
 
Method Summary
 java.lang.String getInitPath()
          Gets the initialization path that is used for locating the initialization process.
 java.lang.String getInitProcessName()
          Gets the initialization process name that is used to start up the operating system.
static void main(java.lang.String[] args)
           
 void setInitPath(java.lang.String initPath)
          Sets the initialization path that is used for locating the initialization process.
 void setInitProcessName(java.lang.String initProcessName)
          Sets the initialization process name that is used to start up the operating system.
 void start()
          Starts the operating system up and begins to run processes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSScheduler

public OSScheduler()
Creates an empty scheduler with no initialization path or initialization process name.

OSScheduler

public OSScheduler(java.lang.String initPath)
Creates a scheduler with the specified initialization path.
Parameters:
initPath -  

OSScheduler

public OSScheduler(java.lang.String initPath,
                   java.lang.String initProcessName)
Creates a scheduler with the specified initialization path and initialization process name.
Parameters:
initPath -  
initProcessName -  
Method Detail

setInitPath

public void setInitPath(java.lang.String initPath)
Sets the initialization path that is used for locating the initialization process.
Parameters:
initPath - the initialization path where the initialization process lives.

getInitPath

public java.lang.String getInitPath()
Gets the initialization path that is used for locating the initialization process.
Returns:
the initialization path where the initialization process lives.

setInitProcessName

public void setInitProcessName(java.lang.String initProcessName)
Sets the initialization process name that is used to start up the operating system.
Parameters:
initProcessName - the name of the process that is used to start up the operating system.

getInitProcessName

public java.lang.String getInitProcessName()
Gets the initialization process name that is used to start up the operating system.
Returns:
the name of the process that is used to start up the operating system.

start

public void start()
Starts the operating system up and begins to run processes. A process can either be a Java class that is subclassed from OSProcess or it can be a script. A script is a text file that contains commands that are executed by an interpreter that is specified as the first line of the file. Script files must end with the .scr extention to be recognized.

main

public static void main(java.lang.String[] args)