jist.runtime
Class ProxyEntity

java.lang.Object
  extended by jist.runtime.Entity.Empty
      extended by jist.runtime.ProxyEntity
All Implemented Interfaces:
Entity, Timeless

final class ProxyEntity
extends Entity.Empty

Implementation of a dynamic Proxy Entity for an object, an entity that forwards all of its calls (according to a mutual interface) to a regular object, but in simulation time.

Since:
JIST1.0
Version:
$Id: ProxyEntity.java,v 1.28 2004/04/06 16:07:43 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu>
See Also:
EntityRef

Nested Class Summary
static class ProxyEntity.ProxyEntityHandler
          Handles all invocations from the Controller on the proxy entity and passes them on to the target object.
 
Nested classes/interfaces inherited from interface jist.runtime.Entity
Entity.Empty, Entity.Static
 
Field Summary
 
Fields inherited from class jist.runtime.Entity.Empty
_jistField__ref
 
Constructor Summary
ProxyEntity()
           
 
Method Summary
static java.lang.Object create(java.lang.Object proxyTarget, java.lang.Class[] proxyInterface)
          Dynamically create a proxy entity for the given target object and interface.
static boolean doesImplement(java.lang.Class c, java.lang.Class ci)
          Check recursively whether a given class implements a given interface.
protected static java.lang.String[] isValidProxyEntity(java.lang.Object proxyTarget, java.lang.Class proxyInterface)
          Verifies the given proxy target and proxy interfaces are valid.
 
Methods inherited from class jist.runtime.Entity.Empty
_jistMethod_Get__ref, _jistMethod_Set__ref
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyEntity

ProxyEntity()
Method Detail

doesImplement

public static boolean doesImplement(java.lang.Class c,
                                    java.lang.Class ci)
Check recursively whether a given class implements a given interface.

Parameters:
c - class to check
ci - interface to check for
Returns:
whether class implements interface

isValidProxyEntity

protected static java.lang.String[] isValidProxyEntity(java.lang.Object proxyTarget,
                                                       java.lang.Class proxyInterface)
Verifies the given proxy target and proxy interfaces are valid. Checks performed include: verify that target implements the interface, the interface does not expose non-final or non-static fields, the interface does not expose non-void methods, the interface does not expose methods that declare exceptions.

Parameters:
proxyTarget - target object for the proxy entity
proxyInterface - interface to be supported by the proxy entity
Returns:
array of error strings, or null if there are no errors found

create

public static java.lang.Object create(java.lang.Object proxyTarget,
                                      java.lang.Class[] proxyInterface)
Dynamically create a proxy entity for the given target object and interface.

Parameters:
proxyTarget - target object for proxy entity
proxyInterface - interface supported by proxy entity
Returns:
proxy entity