edu.ucsb.cs.jicos.services
Class Environment

java.lang.Object
  extended by edu.ucsb.cs.jicos.services.Environment
All Implemented Interfaces:
java.io.Serializable

public final class Environment
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Environment(java.lang.Object input, Shared shared)
          Used to construct the client's computational environment.
 
Method Summary
 void addEvent(java.lang.Object event)
           
 void fetchTask()
          Initiate a non-blocking Task request from the Host's TaskServer.
 java.lang.Object getCache()
          returns host's cache.
 edu.ucsb.cs.jicos.foundation.Q getEventQ()
          returns input that is common to all tasks of this computation.
 java.lang.Object getInput()
          returns input that is common to all tasks of this computation.
 edu.ucsb.cs.jicos.services.external.services.ProxyServiceExternal getProxyServiceExternal()
           
 Shared getShared()
          returns the modifiable Object that is common to all tasks of this computation.
 void setCache(java.lang.Object cache)
          Sets the value of the host's mutable cache Object.
 void setProxyServiceExternal(edu.ucsb.cs.jicos.services.external.services.ProxyServiceExternal proxyServiceExternal)
           
 void setShared(Shared shared)
          Sets the value of the mutable Shared Object that is common to all tasks of this computation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Environment

public Environment(java.lang.Object input,
                   Shared shared)
Used to construct the client's computational environment.

Parameters:
input - Input to the entire computation. Every Task that the client sends to the Hsp has access to it this input. It is immutable. See the TSP example given above.
shared - Every Task that the client sends to the Hsp has access to this object, and can change its value: It is mutable. See the TSP example given above. See Shared.
Method Detail

addEvent

public void addEvent(java.lang.Object event)

fetchTask

public void fetchTask()
Initiate a non-blocking Task request from the Host's TaskServer. This method is used when a task my not construct any subtasks, but it is not known until the execute method is invoked.


getCache

public java.lang.Object getCache()
returns host's cache. Intended to be invoked by hosted Task.

Returns:
The host's cache as an Object: It must be cast appropriately.

getEventQ

public edu.ucsb.cs.jicos.foundation.Q getEventQ()
returns input that is common to all tasks of this computation. Intended to be invoked by hosted Task.

Returns:
The Object that is common to all tasks of this computation: It must be cast appropriately.

getInput

public java.lang.Object getInput()
returns input that is common to all tasks of this computation. Intended to be invoked by hosted Task.

Returns:
The Object that is common to all tasks of this computation: It must be cast appropriately.

getProxyServiceExternal

public edu.ucsb.cs.jicos.services.external.services.ProxyServiceExternal getProxyServiceExternal()

setProxyServiceExternal

public void setProxyServiceExternal(edu.ucsb.cs.jicos.services.external.services.ProxyServiceExternal proxyServiceExternal)

getShared

public Shared getShared()
returns the modifiable Object that is common to all tasks of this computation. Intended to be invoked by hosted Task.

Returns:
The modifiable Object that is common to all tasks of this computation: It must be cast appropriately.

setCache

public void setCache(java.lang.Object cache)
Sets the value of the host's mutable cache Object. Intended to be invoked by a Task.

Parameters:
cache - The new cache value.

setShared

public void setShared(Shared shared)
Sets the value of the mutable Shared Object that is common to all tasks of this computation. Jicos propagates this value until either all Hosts have received it, or some TaskServer deems it not new. See Shared. Intended to be invoked by a Task.

Parameters:
shared - The Shared Object value proposed by the invoking task as being a newer value for the Shared Object.


Jicos: http://cs.ucsb.edu/projects/jicos