Class JsvManager

java.lang.Object
com.sun.grid.jsv.JsvManager

public class JsvManager extends Object
The JsvManager class is implements the JSV protocol. A JSV can use the JsvManager class either by instantiating an instance and passing in the Jsv implementation instance or by running the JsvManager class directly and passing as an arguement the name of the class to be run as the Jsv implementation. Once started, the JsvManager instance reads the input from the JSV framework from stdin and writes commands to stdout. The JSV protocol is completely encapsulated, however, allowing the Jsv implementation to work at the level of JobDescription objects. The JsvManager class uses the Logger named "com.sun.grid.Jsv". By default the Logger is set not to pass log records to its parent logger because the default Logger writes to stdout and would disrupt the JSV protocol. By default, the Logger has no handlers installed. In order to enable logging, add a handler, i.e. a FileHandler instance. It is always a good idea to enabling logging, as errors in JSV protocol handling will be logged as warnings, but will not be visible any other way. TODO: Write docs TODO: Add method to log the entire parameter set TODO: Look at showMaps() to see if it can be done more cleanly TODO: Add main() method TODO: ant script TODO: Wrapper script TODO: correct=>modify in other languages
Since:
6.2u5
See Also:
  • Constructor Details

    • JsvManager

      public JsvManager()
  • Method Details

    • main

      public static void main(String[] args)
      The main() method takes the name of a Jsv implementation class and uses that class to instantiate and run a JSV.
      Parameters:
      args - String array that contains the name of the class to run
    • parse

      public void parse(Jsv jsv) throws IOException
      Start the JSV. This method reads input and triggers appropriate actions on the given Jsv implementation. It will not return until it receives the "QUIT" command from the JSV framework.
      Parameters:
      jsv - The Jsv implementation to be run
      Throws:
      IOException - Thrown if it is not possible to communicate with the JSV framework
    • log

      public void log(JsvManager.LogLevel level, String message)
      Write a log message to the JSV's log.
      Parameters:
      level - The LogLevel to use for the message
      message - The message to log
    • accept

      public void accept(String message)
      Accept the job.
      Parameters:
      message - Detail about the acceptance
    • modify

      public void modify(String message)
      Modify the job.
      Parameters:
      message - Detail about the modification
    • reject

      public void reject(String message)
      Reject the job.
      Parameters:
      message - Detail about the rejection
    • rejectWait

      public void rejectWait(String message)
      Reject the job but indicate that it may succeed later.
      Parameters:
      message - Detail about the rejection
    • setResult

      public void setResult(JsvManager.Result result, String message)
      Set the result of the JSV verification operation.
      Parameters:
      result - The result of the verification operation
      message - Detail about the result
    • getResult

      public JsvManager.Result getResult()
      Return the current result. The result is not final until the onVerify() method has returned.
      Returns:
      the current result
      See Also:
    • requestEnvironment

      public void requestEnvironment(boolean request)
      Indicate whether the JSV is interested in information about jobs' environment variables. This method is normally called from the onStart() method, but it can be called any time prior to the receipt of a "START" command
      Parameters:
      request - Whether to request that the JSV framework send the complete list of environment variables for every job.
      See Also:
    • getJobDescription

      public JobDescription getJobDescription()
      Get the description of the job for the current verification operation.
      Returns:
      the current job description