dcf.client
Class Worker

dcf.client.Worker
All Implemented Interfaces:
WorkerInt

public class Worker
implements WorkerInt

The Worker handle the connection to the server, it recieves new tasks executes them and returns the result to the server

Author:
Tal Salmona

Constructor Summary
Worker(WorkerGroup parent)
           
 
Method Summary
 void addMessage(dcf.client.String str)
          Add a message to parents message box
 void connect()
          Connect to the distributer.
 float getProgress()
          Allows the server to view the task's progress.
 Task getTask()
           
 void go()
          The Worker's parent should use this method to start the worker.
 void kill()
          The worker's parent should use this method to stop the worker.
 void run()
           
 void setProgress(float i)
          Sets task's progress
 

Constructor Detail

Worker

public Worker(WorkerGroup parent)
       throws dcf.client.RemoteException
Method Detail

connect

public void connect()
Connect to the distributer.

run

public void run()

go

public void go()
The Worker's parent should use this method to start the worker.

kill

public void kill()
The worker's parent should use this method to stop the worker.

addMessage

public void addMessage(dcf.client.String str)
Add a message to parents message box
Parameters:
str - The message to add.

setProgress

public void setProgress(float i)
Sets task's progress
Parameters:
i - - 0.0 to 1.0 shows the progress of the task.

getTask

public Task getTask()
Returns:
The task this worker is currently running

getProgress

public float getProgress()
                  throws dcf.client.RemoteException
Allows the server to view the task's progress.
Specified by:
getProgress in interface WorkerInt
Returns:
The progress for this worker.
Throws:
dcf.client.RemoteException - A remote exception if the Interface cannot be found.




Distributed Computation Framework