|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsystem.Space
public class Space
A Space that will Q new tasks issued to it by a client and hand them out to registered computers. Performs load balancing across different available machines, and stores the results for the client.
Field Summary |
---|
Fields inherited from interface system.Computer2Space |
---|
SERVICE_NAME |
Fields inherited from interface client.Client2Space |
---|
SERVICE_NAME |
Constructor Summary | |
---|---|
Space()
|
Method Summary | |
---|---|
Result |
compute(Task task,
java.lang.Object input,
Shared shared)
Takes in a task to be handled by the space. |
void |
enqueueResult(Result result)
If the result is non-null it determines if the Result should be drain to a task in the waiting Queue, or if it should be returned to the client. |
void |
enqueueTask(Task task)
Puts a computer task into the task queue |
Task |
getNextTask()
Removes the next task from the task queue. |
Shared |
getShared()
Gets the current shared value from the system. |
Statistics |
getStatistics()
Gets the statistics package from the space Can be extended to include any needed. |
int |
getUniqueTaskID()
returns the system wide unique Task ID |
void |
hello()
|
static void |
main(java.lang.String[] args)
Creates a registry and binds itself to that registry. |
void |
put(GUI_Client client,
Task task)
Takes in a task to be done. |
void |
register(Computer computer)
Adds the Computer to the list of valid computers the space can utilize. |
void |
setShared(Shared proposedShared)
Set the shared object on the Space and propagates this Shared object to all the registered computers |
Result |
take()
Returns a result from the Result Queue. |
boolean |
unregister(ComputerProxy proxy,
Task currentRunningTask)
Unregister the computer proxy that has thrown a remote exception |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Space()
Method Detail |
---|
public Shared getShared()
getShared
in interface Client2Space
public Result compute(Task task, java.lang.Object input, Shared shared)
compute
in interface Client2Space
task
- userShared;
- public void put(GUI_Client client, Task task) throws java.rmi.RemoteException
put
in interface Client2Space
task
- The task that should be completed by a Computer.
java.rmi.RemoteException
public Result take() throws java.rmi.RemoteException
take
in interface Client2Space
java.rmi.RemoteException
public Statistics getStatistics()
getStatistics
in interface Client2Space
public int getUniqueTaskID()
getUniqueTaskID
in interface Computer2Space
public Task getNextTask() throws java.rmi.RemoteException
getNextTask
in interface Computer2Space
java.rmi.RemoteException
public void register(Computer computer) throws java.rmi.RemoteException
register
in interface Computer2Space
computer
- A reference to the new available computer.
java.rmi.RemoteException
public boolean unregister(ComputerProxy proxy, Task currentRunningTask)
proxy
-
public void enqueueTask(Task task) throws java.rmi.RemoteException
enqueueTask
in interface Computer2Space
task
-
java.rmi.RemoteException
public void enqueueResult(Result result) throws java.rmi.RemoteException
enqueueResult
in interface Computer2Space
result
- The result to be placed in the queue.
java.rmi.RemoteException
public void setShared(Shared proposedShared) throws java.rmi.RemoteException
setShared
in interface Computer2Space
propposedShared
- the proposed shared object
java.rmi.RemoteException
public void hello() throws java.rmi.RemoteException
hello
in interface Computer2Space
java.rmi.RemoteException
public static void main(java.lang.String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |