orc.runtime.sites
Class Site

java.lang.Object
  extended by orc.runtime.values.Value
      extended by orc.runtime.sites.Site
All Implemented Interfaces:
Callable
Direct Known Subclasses:
Apply, ClassProxy, DotSite, Error, EvalSite, IsNone, IsSome, KilimSite, Ltimer, MethodProxy, None, ObjectProxy, PartialSite, PopLtimer, Print, Println, PushLtimer, Rtimer, Some, ThreadedObjectProxy, ThreadedPartialSite, ThreadedSite, TryCons, TryNil

public abstract class Site
extends Value
implements Callable

Base class for all sites

Author:
wcook, dkitchin

Field Summary
 
Fields inherited from class orc.runtime.values.Value
futureNotReady
 
Constructor Summary
Site()
           
 
Method Summary
<E> E
accept(Visitor<E> visitor)
           
abstract  void callSite(Args args, Token caller)
          Must be implemented by subclasses to implement the site behavior
 void createCall(Token callToken, java.util.List<java.lang.Object> args, TokenContinuation publishContinuation)
          Invoked by a Call to invoke a site.
 Type type()
           
 
Methods inherited from class orc.runtime.values.Value
forceArg, forceCall, signal, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Site

public Site()
Method Detail

createCall

public void createCall(Token callToken,
                       java.util.List<java.lang.Object> args,
                       TokenContinuation publishContinuation)
                throws TokenException
Invoked by a Call to invoke a site. The argument list is scanned to make sure that all parameters are bound. If an unbound parameter is found, the call is placed on a queue and nothing more is done. Once all parameters are bound, their values are collected and the corresponding subclass (the actual site) is called.

Specified by:
createCall in interface Callable
Parameters:
callToken - token for which the call is being made: points to the call node
args - argument list
publishContinuation - next node after the call node, to which the result should be sent
Throws:
TokenException
See Also:
Callable.createCall(Token, List, TokenContinuation)

callSite

public abstract void callSite(Args args,
                              Token caller)
                       throws TokenException
Must be implemented by subclasses to implement the site behavior

Parameters:
args - list of argument values
caller - where the result should be sent
Throws:
TokenException

accept

public <E> E accept(Visitor<E> visitor)
Overrides:
accept in class Value

type

public Type type()
          throws TypeException
Throws:
TypeException