orc.runtime.sites
Class DotSite

java.lang.Object
  extended by orc.runtime.values.Value
      extended by orc.runtime.sites.Site
          extended by orc.runtime.sites.DotSite
All Implemented Interfaces:
Callable, TraceableValue
Direct Known Subclasses:
BoundedBuffer.BufferInstance, Buffer.BufferInstance, Cell.CellInstance, Datasite, FieldProxy, Ref.RefInstance, Semaphore.SemaphoreInstance, SyncChannel.SyncChannelInstance, TupleValue

public abstract class DotSite
extends Site
implements TraceableValue

Dot-accessible sites should extend this class and declare their Orc-available methods using addMembers(). The code is forward-compatible with many possible optimizations on the field lookup strategy. A dot site may also have a default behavior which allows it to behave like a normal site. If its argument is not a message, it displays that default behavior, if implemented. If there is no default behavior, it raises a type error.

Author:
dkitchin

Field Summary
 
Fields inherited from class orc.runtime.values.Value
futureNotReady
 
Constructor Summary
DotSite()
           
 
Method Summary
protected  void addMember(java.lang.String f, java.lang.Object s)
           
protected abstract  void addMembers()
           
 void callSite(Args args, Token t)
          Must be implemented by subclasses to implement the site behavior
protected  void defaultTo(Args args, Token token)
           
 Value marshal(Marshaller tracer)
           
 
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

DotSite

public DotSite()
Method Detail

callSite

public void callSite(Args args,
                     Token t)
              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
t - where the result should be sent
Throws:
TokenException

addMembers

protected abstract void addMembers()

addMember

protected void addMember(java.lang.String f,
                         java.lang.Object s)

defaultTo

protected void defaultTo(Args args,
                         Token token)
                  throws TokenException
Throws:
TokenException

marshal

public Value marshal(Marshaller tracer)
Specified by:
marshal in interface TraceableValue