computer
Class ComputerImpl

java.lang.Object
  extended by computer.ComputerImpl
All Implemented Interfaces:
Computer, java.io.Serializable, java.rmi.Remote

public class ComputerImpl
extends java.lang.Object
implements Computer

A "server" that accepts tasks from a remote user, and returns them

Author:
Diana Abbas, Ryan Neal
See Also:
Serialized Form

Constructor Summary
ComputerImpl(Computer2Space stub)
           
 
Method Summary
 long getComputerTimeUp()
           
 int getUniqueTaskID()
          Requests from the Space a unique ID for the task.
 void hello()
           
static void main(java.lang.String[] args)
           
 Result run(Task task)
          Runs the task and returns its return value
 void setShared(Shared proposedShared)
          Check the shared coming from the task if it is better than the current shared then pass it on to the space
 void spawn(Task task)
          Passes the task back to the space in order for it to be scheduled.
 void updateShared(Shared proposedShared)
          The Space is telling the Computer that there is an update to the shared value, check it and store it
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComputerImpl

public ComputerImpl(Computer2Space stub)
Method Detail

run

public Result run(Task task)
           throws java.rmi.RemoteException
Runs the task and returns its return value

Specified by:
run in interface Computer
Returns:
The object specified by the task
Throws:
java.rmi.RemoteException

updateShared

public void updateShared(Shared proposedShared)
The Space is telling the Computer that there is an update to the shared value, check it and store it

Specified by:
updateShared in interface Computer
Parameters:
shared -

spawn

public void spawn(Task task)
Passes the task back to the space in order for it to be scheduled.

Specified by:
spawn in interface Computer
Parameters:
task - The new task that is to be scheduled.

getUniqueTaskID

public int getUniqueTaskID()
Requests from the Space a unique ID for the task.

Specified by:
getUniqueTaskID in interface Computer
Returns:
The TaskID that the space has assigned.

setShared

public void setShared(Shared proposedShared)
Check the shared coming from the task if it is better than the current shared then pass it on to the space

Specified by:
setShared in interface Computer
Parameters:
shared -

getComputerTimeUp

public long getComputerTimeUp()
Specified by:
getComputerTimeUp in interface Computer

hello

public void hello()
Specified by:
hello in interface Computer

main

public static void main(java.lang.String[] args)