system
Class ComputerProxy

java.lang.Object
  extended by system.ComputerProxy
All Implemented Interfaces:
java.lang.Runnable

public class ComputerProxy
extends java.lang.Object
implements java.lang.Runnable

A thread that handles a Computer when it registers to the Space. A reference must also be passed into it in order to take Tasks and add Results.

Author:
Sean Ford

Constructor Summary
ComputerProxy(Computer computer, java.lang.Long computerId, Space space, NetworkHandle handle)
          Constructor.
 
Method Summary
 void addTask(Task task)
          Add a Task to the local task queue.
 NetworkHandle getNetworkHandle()
           
 void run()
          Loop indefinitely getting Tasks and running them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComputerProxy

public ComputerProxy(Computer computer,
                     java.lang.Long computerId,
                     Space space,
                     NetworkHandle handle)
Constructor.

Parameters:
computer -
space -
Method Detail

getNetworkHandle

public NetworkHandle getNetworkHandle()

addTask

public void addTask(Task task)
Add a Task to the local task queue. This allows you to send specific Tasks to certain Computers.

Parameters:
task -

run

public void run()
Loop indefinitely getting Tasks and running them. Add result to resultQueue after running them.

Specified by:
run in interface java.lang.Runnable