net.sf.j3d.threeD.raytracer.network
Class JobProducer

java.lang.Object
  extended by net.sf.j3d.threeD.raytracer.network.JobProducer

public class JobProducer
extends Object

A JobProducer object is used to produce and send jobs to a network node.

Author:
Mike Murray

Field Summary
static String helpText
           
 
Constructor Summary
JobProducer(String[] args)
           
 
Method Summary
 String getHost()
           
 void init(String sceneURI, int w, int h, int ssw, int ssh, int jobSize, long jobId, double pw, double ph, double fl, double clx, double cly, double clz, double cdx, double cdy, double cdz, double pri)
          Constructs a new JobProducer object.
static void main(String[] args)
          Constructs a JobProducer object and uses it to produce and send jobs described by the command line arguments.
 void sendAllJobs()
          Sends all jobs to the server.
 void sendJobs(int total)
          Sends some jobs to the server.
 String sendTask()
           
 void setServer(String host, int port)
          Sets the hostname and port of the server (network node) to send jobs to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

helpText

public static final String helpText
See Also:
Constant Field Values
Constructor Detail

JobProducer

public JobProducer(String[] args)
Method Detail

main

public static void main(String[] args)
Constructs a JobProducer object and uses it to produce and send jobs described by the command line arguments.

Parameters:
args - See field JobProducer.helpText.

init

public void init(String sceneURI,
                 int w,
                 int h,
                 int ssw,
                 int ssh,
                 int jobSize,
                 long jobId,
                 double pw,
                 double ph,
                 double fl,
                 double clx,
                 double cly,
                 double clz,
                 double cdx,
                 double cdy,
                 double cdz,
                 double pri)
Constructs a new JobProducer object.

Parameters:
sceneURI - URI of XML scene file to render.
w - Width of image.
h - Height of image.
ssw - Supersample width.
ssh - Supersample height.
jobSize - Number of pixels to render per job.
jobId - Unique id to use for jobs.

getHost

public String getHost()

sendTask

public String sendTask()

sendJobs

public void sendJobs(int total)
              throws IOException
Sends some jobs to the server.

Parameters:
total - Number of jobs to send.
Throws:
IOException - If an IOException is thrown by NetworkClient.sendJob

sendAllJobs

public void sendAllJobs()
                 throws IOException
Sends all jobs to the server.

Throws:
IOException - If an IOException is thrown by NetworkClient.sendJob

setServer

public void setServer(String host,
                      int port)
Sets the hostname and port of the server (network node) to send jobs to.

Parameters:
host - Hostname of server.
port - Port of server.