jist.runtime
Class ProxyEntity
java.lang.Object
jist.runtime.Entity.Empty
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. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProxyEntity
ProxyEntity()
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 checkci
- 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 entityproxyInterface
- 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 entityproxyInterface
- interface supported by proxy entity
- Returns:
- proxy entity