orc.runtime.sites
Class KilimSite

java.lang.Object
  extended by orc.runtime.values.Value
      extended by orc.runtime.sites.Site
          extended by orc.runtime.sites.KilimSite
All Implemented Interfaces:
Callable

public abstract class KilimSite
extends Site

Use Kilim to run a site with lightweight threads and no direct access to tokens.

The site's evaluate method is run in a Kilim Task. If the task calls Task.exit(Object), the token is killed; if the task throws an exception, the token is killed with an error. Otherwise the token uses the return value.

Killing a token will not automatically exit the corresponding task, because we don't know what kind of cleanup may be necessary and tasks don't provide a good way to define such.

Author:
quark

Field Summary
 
Fields inherited from class orc.runtime.values.Value
futureNotReady
 
Constructor Summary
KilimSite()
           
 
Method Summary
 void callSite(Args args, Token caller)
          Must be implemented by subclasses to implement the site behavior
abstract  java.lang.Object evaluate(Args args)
           
 java.lang.Object evaluate(Args args, kilim.Fiber f)
          FIXME: Kilim should add this method but it doesn't
 
Methods inherited from class orc.runtime.sites.Site
accept, createCall, 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

KilimSite

public KilimSite()
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 java.lang.Object evaluate(Args args)
                                   throws kilim.Pausable,
                                          TokenException
Throws:
kilim.Pausable
TokenException

evaluate

public java.lang.Object evaluate(Args args,
                                 kilim.Fiber f)
                          throws kilim.Pausable,
                                 TokenException
FIXME: Kilim should add this method but it doesn't

Throws:
kilim.Pausable
TokenException