orc.runtime.sites.java
Class ClassProxy

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

public class ClassProxy
extends Site

Author:
dkitchin, quark

Field Summary
 
Fields inherited from class orc.runtime.values.Value
futureNotReady
 
Method Summary
 void callSite(Args args, Token caller)
          Must be implemented by subclasses to implement the site behavior
static ClassProxy forClass(java.lang.Class c)
          These objects are cached so that instances of a class can share the same method handles.
 java.lang.reflect.Field getField(Token token, java.lang.String name)
          Look up a field by name.
 java.lang.Object getMember(Token token, java.lang.Object self, java.lang.String name)
          Get the value of an object member (method or field).
 MethodHandle getMethod(Token token, java.lang.String methodName)
          Look up a method by name.
 Type type()
           
 
Methods inherited from class orc.runtime.sites.Site
accept, createCall
 
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
 

Method Detail

forClass

public static ClassProxy forClass(java.lang.Class c)
These objects are cached so that instances of a class can share the same method handles.


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

getMember

public java.lang.Object getMember(Token token,
                                  java.lang.Object self,
                                  java.lang.String name)
                           throws MessageNotUnderstoodException,
                                  CapabilityException,
                                  java.lang.SecurityException
Get the value of an object member (method or field). If a method and field have the same name, the method is prefered. Since in Java method values aren't first class we wrap these in a MethodProxy.

Throws:
java.lang.SecurityException
CapabilityException
MessageNotUnderstoodException

getField

public java.lang.reflect.Field getField(Token token,
                                        java.lang.String name)
                                 throws java.lang.SecurityException,
                                        java.lang.NoSuchFieldException,
                                        CapabilityException
Look up a field by name. FIXME: should distinguish between static and non-static fields?

Throws:
CapabilityException
java.lang.SecurityException
java.lang.NoSuchFieldException

getMethod

public MethodHandle getMethod(Token token,
                              java.lang.String methodName)
                       throws MessageNotUnderstoodException,
                              CapabilityException
Look up a method by name. Method handles are cached so that future lookups can go faster. FIXME: should distinguish between static and non-static methods?

Throws:
CapabilityException
MessageNotUnderstoodException

type

public Type type()
Overrides:
type in class Site