provided.engine.model
Class ComputeEngine

java.lang.Object
  extended by provided.engine.model.ComputeEngine
All Implemented Interfaces:
java.rmi.Remote, ICompute

public class ComputeEngine
extends java.lang.Object
implements ICompute

A concrete implementation of an ICompute engine


Field Summary
private  IRemoteTaskViewAdapter clientTVA
          A remote view adapter connected to the client's view
private  ILocalTaskViewAdapter taskView
          A local task view adapter that delegates the to the main view adapter.
private  IVoidLambda<java.lang.String> viewCmd
          A command (lambda) that serves as an adapter to the view
 
Fields inherited from interface provided.compute.ICompute
BOUND_NAME, BOUND_PORT
 
Constructor Summary
ComputeEngine(IVoidLambda<java.lang.String> viewCmd)
          The constructor for the class
 
Method Summary
<T> T
executeTask(ITask<T> t)
          Executes the given task and returns the result.
 IRemoteTaskViewAdapter setTextAdapter(IRemoteTaskViewAdapter clientTVA)
          Sets a remote view adapter for the server to use to display info on the client's view and returns a remote view adapter for the client to use to display info on the server's view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewCmd

private IVoidLambda<java.lang.String> viewCmd
A command (lambda) that serves as an adapter to the view


taskView

private ILocalTaskViewAdapter taskView
A local task view adapter that delegates the to the main view adapter.


clientTVA

private IRemoteTaskViewAdapter clientTVA
A remote view adapter connected to the client's view

Constructor Detail

ComputeEngine

public ComputeEngine(IVoidLambda<java.lang.String> viewCmd)
The constructor for the class

Parameters:
viewCmd - The adapter to the view
Method Detail

executeTask

public <T> T executeTask(ITask<T> t)
Executes the given task and returns the result. This method is called by the remote client to execute its task.

Specified by:
executeTask in interface ICompute
Type Parameters:
T - The type of the return value from executing the given ITask object
Parameters:
t - The ITask object to execute
Returns:
The result from executing the ITask object

setTextAdapter

public IRemoteTaskViewAdapter setTextAdapter(IRemoteTaskViewAdapter clientTVA)
Sets a remote view adapter for the server to use to display info on the client's view and returns a remote view adapter for the client to use to display info on the server's view.

Specified by:
setTextAdapter in interface ICompute
Parameters:
clientTVA - Remote task view adapter stub from the client
Returns:
A remote task view adapter stub for the client to use.