com.nukernel.jdcf
Class Job

java.lang.Object
  |
  +--net.jini.entry.AbstractEntry
        |
        +--com.nukernel.jdcf.Job

public class Job
extends net.jini.entry.AbstractEntry
implements net.jini.lookup.ServiceIDListener

This class represents jobs (aka programs) in the form in which they are passed to the system by the front end and shipped about inside the system.

See Also:
Serialized Form

Field Summary
 java.util.Vector allocatedNodes
          Nodes on which the computation is actually running.
 java.lang.String[] args
          Arguments given to the job by the front end.
 Communicator comm
          The object used for internode communication.
 java.lang.String description
          A user-supplied text description of what the job is doing.
 boolean init
           
 net.jini.space.JavaSpace js
          A Jini service similar to a tuple-space in Linda that is stores objects and is also used for coordination.
 java.lang.String label
          A front-end generated, globally unique identifier by which one may refer to the job.
 java.io.PrintStream out
           
 Program prog
          An object containing the code to be run in the computation.
 java.util.Vector requestedNodes
          Nodes on which the job submitter requested the job be run.
 java.lang.Object result
           
 SubmissionFailedException sfe
          Used internally for interthread communication while submitting the job to the system.
 java.lang.String space
          The name of the JavaSpace which the job should use.
 java.lang.Integer status
          The current state (running, etc.) of the job.
static java.lang.Integer STATUS_COMPLETE
          The job has finished executing and its output has been collected.
static java.lang.Integer STATUS_READY
          The job is waiting to be run.
static java.lang.Integer STATUS_RUNNING
          The job is running.
 
Constructor Summary
Job()
          Default constructor.
Job(Program prog, java.lang.String space, int desiredNodes, java.lang.String description, java.lang.String[] args)
          Build a parallel job.
 
Method Summary
 void kill()
          Request that the job abort execution.
 void resume()
          Restart a suspended job.
 void serviceIDNotify(net.jini.core.lookup.ServiceID id)
           
 java.lang.Object status()
          Obtain from the running computation, a representation of its current status.
 void submit()
          Submit a job for execution.
 void submit(java.io.PrintStream out)
           
 void suspend()
          Request that the job temporarily stop executing.
 void update()
          Update internal job state from the JavaSpace.
 void watch()
          Receive console output from the running job and block until the job terminates.
 
Methods inherited from class net.jini.entry.AbstractEntry
equals, equals, hashCode, hashCode, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_READY

public static final java.lang.Integer STATUS_READY
The job is waiting to be run.

STATUS_RUNNING

public static final java.lang.Integer STATUS_RUNNING
The job is running.

STATUS_COMPLETE

public static final java.lang.Integer STATUS_COMPLETE
The job has finished executing and its output has been collected.

description

public java.lang.String description
A user-supplied text description of what the job is doing.

space

public java.lang.String space
The name of the JavaSpace which the job should use.

label

public java.lang.String label
A front-end generated, globally unique identifier by which one may refer to the job.

args

public java.lang.String[] args
Arguments given to the job by the front end.

status

public java.lang.Integer status
The current state (running, etc.) of the job.

allocatedNodes

public java.util.Vector allocatedNodes
Nodes on which the computation is actually running.

requestedNodes

public java.util.Vector requestedNodes
Nodes on which the job submitter requested the job be run.

result

public java.lang.Object result

prog

public Program prog
An object containing the code to be run in the computation.

js

public net.jini.space.JavaSpace js
A Jini service similar to a tuple-space in Linda that is stores objects and is also used for coordination.

comm

public transient Communicator comm
The object used for internode communication.

sfe

public transient SubmissionFailedException sfe
Used internally for interthread communication while submitting the job to the system.

out

public transient java.io.PrintStream out

init

public transient volatile boolean init
Constructor Detail

Job

public Job()
Default constructor.

Job

public Job(Program prog,
           java.lang.String space,
           int desiredNodes,
           java.lang.String description,
           java.lang.String[] args)
Build a parallel job.
Parameters:
prog - code object representing the program
space - name of the JavaSpace to be used for coordination
desiredNodes - the number of nodes on which the computation should be run, if possible
description - a textual explanation of what the job is doing
args - command line arguments for the job
Method Detail

submit

public void submit()
            throws SpaceNotFoundException,
                   SubmissionFailedException
Submit a job for execution.
Throws:
SpaceNotFoundException - if the specified JavaSpace to be used for coordination could not be located
SubmissionFailedException - if a general error occurred while submitting the job

submit

public void submit(java.io.PrintStream out)
            throws SpaceNotFoundException,
                   SubmissionFailedException

status

public java.lang.Object status()
                        throws java.rmi.RemoteException
Obtain from the running computation, a representation of its current status.
Throws:
java.rmi.RemoteException - if a communication error occurs

suspend

public void suspend()
             throws java.rmi.RemoteException
Request that the job temporarily stop executing.
Throws:
java.rmi.RemoteException - if a communication error occurs

resume

public void resume()
            throws java.rmi.RemoteException
Restart a suspended job.
Throws:
java.rmi.RemoteException - if a communication error occurs

kill

public void kill()
          throws java.rmi.RemoteException
Request that the job abort execution.
Throws:
java.rmi.RemoteException - if a communication error occurs

serviceIDNotify

public void serviceIDNotify(net.jini.core.lookup.ServiceID id)
Specified by:
serviceIDNotify in interface net.jini.lookup.ServiceIDListener

watch

public void watch()
Receive console output from the running job and block until the job terminates.

update

public void update()
Update internal job state from the JavaSpace. No effort is made to keep job objects in sync with the actual state of the computation.

Java Distributed
Computational
Framework v0.1

Copyright © 2000 Sidney Cammeresi. All rights reserved.