orc.runtime.sites
Class SimpleSite

java.lang.Object
  extended by orc.runtime.values.Value
      extended by orc.runtime.sites.Site
          extended by orc.runtime.sites.SimpleSite
All Implemented Interfaces:
Callable, Future
Direct Known Subclasses:
MethodProxy

public abstract class SimpleSite
extends Site

Simple sites which don't need access to tokens. Cooperative threading is provided via orc.runtime.Continuation. This class makes it easy to implement variations on EvalSite, ThreadedSite, PartialSite, and combinations thereof.

Author:
quark

Constructor Summary
SimpleSite()
           
 
Method Summary
 void callSite(Args args, Token caller)
          Must be implemented by subclasses to implement the site behavior
abstract  Value evaluate(Args args)
          If this method calls Continuation.suspend(), its return value will be ignored and the engine will expect the method to resume or kill the continuation when ready.
 
Methods inherited from class orc.runtime.sites.Site
accept, createCall
 
Methods inherited from class orc.runtime.values.Value
forceArg, forceCall, head, isCons, isNil, isNone, isSome, signal, tail, untag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSite

public SimpleSite()
Method Detail

callSite

public void callSite(Args args,
                     Token caller)
              throws TokenException
Description copied from class: Site
Must be implemented by subclasses to implement the site behavior

Specified by:
callSite in class Site
Parameters:
args - list of argument values
caller - where the result should be sent
Throws:
TokenException

evaluate

public abstract Value evaluate(Args args)
                        throws TokenException
If this method calls Continuation.suspend(), its return value will be ignored and the engine will expect the method to resume or kill the continuation when ready. Otherwise, the site is assumed to be total and immediate and the return value will be used as the published value of the call.

Throws:
TokenException