|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grid.jsv.JsvManager
public class JsvManager
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
JobDescription
Nested Class Summary | |
---|---|
static class |
JsvManager.LogLevel
The LogLevel enumeration is used to control the log level of messages logged through the JSV framework. |
static class |
JsvManager.Result
The Result enumeration is used to set the result of a JSV verification operation. |
Constructor Summary | |
---|---|
JsvManager()
|
Method Summary | |
---|---|
void |
accept(java.lang.String message)
Accept the job. |
JobDescription |
getJobDescription()
Get the description of the job for the current verification operation. |
JsvManager.Result |
getResult()
Return the current result. |
void |
log(JsvManager.LogLevel level,
java.lang.String message)
Write a log message to the JSV's log. |
static void |
main(java.lang.String[] args)
The main() method takes the name of a Jsv implementation class and uses that class to instantiate and run a JSV. |
void |
modify(java.lang.String message)
Modify the job. |
void |
parse(Jsv jsv)
Start the JSV. |
void |
reject(java.lang.String message)
Reject the job. |
void |
rejectWait(java.lang.String message)
Reject the job but indicate that it may succeed later. |
void |
requestEnvironment(boolean request)
Indicate whether the JSV is interested in information about jobs' environment variables. |
void |
setResult(JsvManager.Result result,
java.lang.String message)
Set the result of the JSV verification operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JsvManager()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- String array that contains the name of the class to runpublic void parse(Jsv jsv) throws java.io.IOException
jsv
- The Jsv implementation to be run
java.io.IOException
- Thrown if it is not possible to communicate with the
JSV frameworkpublic void log(JsvManager.LogLevel level, java.lang.String message)
level
- The LogLevel to use for the messagemessage
- The message to logpublic void accept(java.lang.String message)
message
- Detail about the acceptancepublic void modify(java.lang.String message)
message
- Detail about the modificationpublic void reject(java.lang.String message)
message
- Detail about the rejectionpublic void rejectWait(java.lang.String message)
message
- Detail about the rejectionpublic void setResult(JsvManager.Result result, java.lang.String message)
result
- The result of the verification operationmessage
- Detail about the resultpublic JsvManager.Result getResult()
Jsv.onVerify(com.sun.grid.jsv.JsvManager)
public void requestEnvironment(boolean request)
request
- Whether to request that the JSV framework send the
complete list of environment variables for every job.Jsv.onStart(com.sun.grid.jsv.JsvManager)
public JobDescription getJobDescription()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |