Class RemoteReferenceModule
- java.lang.Object
-
- jadex.platform.service.serialization.RemoteReferenceModule
-
public class RemoteReferenceModule extends java.lang.ObjectThis class implements the rmi handling. It mainly supports: - remote reference management - creation of proxy references for transferring IProxyable objects - creation of proxies on the remote side of a target object - distributed garbage collection for target (remote) objects using reference counting - management of interfaceproperties for metadata such as exclusion or replacement of methods
-
-
Field Summary
Fields Modifier and Type Field Description protected IComponentIdentifierplatformThe platform cid.protected java.util.List<ITraverseProcessor>processorsThe clone processors.protected java.util.Map<java.lang.Object,jadex.bridge.component.impl.remotecommands.ProxyInfo>proxyinfosThe cache of proxy infos (class -> proxy info).protected java.util.Map<java.lang.Class<?>,boolean[]>referencesThe reference class cache (clazz->boolean (is reference)).static java.util.Map<java.lang.Class<?>,boolean[]>REFERENCESThe predefined reference settings (clazz->boolean (is reference)).
-
Constructor Summary
Constructors Constructor Description RemoteReferenceModule(IComponentIdentifier platform)Create a new remote reference module.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddCachedMethodValue(jadex.bridge.component.impl.remotecommands.ProxyReference pr, jadex.bridge.component.impl.remotecommands.ProxyInfo pi, java.lang.reflect.Method m, java.lang.Object target)Add a cached method value to the proxy info.voidaddCloneProcessor(ITraverseProcessor proc)Add a clone processor.static jadex.bridge.component.impl.remotecommands.ProxyInfocreateProxyInfo(java.lang.Object target, java.lang.Class<?>[] remoteinterfaces, java.lang.ClassLoader cl, IComponentIdentifier platform)Create a proxy info for a service.java.util.List<ITraverseProcessor>getCloneProcessors()Get the clone processors.static MethodInfo[]getMethodInfo(java.lang.Object iden, java.lang.Class<?> targetclass, boolean noargs)Get method info.java.lang.ObjectgetProxy(jadex.bridge.component.impl.remotecommands.ProxyReference pr, java.lang.ClassLoader classloader)Get a proxy for a proxy reference.jadex.bridge.component.impl.remotecommands.ProxyReferencegetProxyReference(java.lang.Object target, IComponentIdentifier tmpholder, java.lang.ClassLoader cl)Get a remote reference for a component for transport.static java.lang.Class<?>[]getRemoteInterfaces(java.lang.Object object, java.lang.ClassLoader cl)Get the proxy interfaces (empty list if none).protected static jadex.bridge.component.impl.remotecommands.RemoteReferencegetRemoteReference(java.lang.Object target)Get a remote reference.static jadex.bridge.component.impl.remotecommands.RemoteReferencegetRemoteReference(java.lang.Object target, java.lang.Object orig)Get a remote reference.java.lang.ObjectgetTargetObject(jadex.bridge.component.impl.remotecommands.RemoteReference rr)Get a target object per remote reference.booleanisLocalReference(java.lang.Object object)Test if an object has reference semantics.booleanisReference(java.lang.Object object, boolean local)Test if an object has reference semantics.booleanisRemoteObject(java.lang.Object target)Test if an object is a remote object.booleanisRemoteReference(java.lang.Object object)Test if an object has reference semantics.voidremoveCloneProcessor(ITraverseProcessor proc)Remove a clone processor.
-
-
-
Field Detail
-
REFERENCES
public static final java.util.Map<java.lang.Class<?>,boolean[]> REFERENCES
The predefined reference settings (clazz->boolean (is reference)).
-
platform
protected IComponentIdentifier platform
The platform cid.
-
references
protected java.util.Map<java.lang.Class<?>,boolean[]> references
The reference class cache (clazz->boolean (is reference)).
-
proxyinfos
protected java.util.Map<java.lang.Object,jadex.bridge.component.impl.remotecommands.ProxyInfo> proxyinfos
The cache of proxy infos (class -> proxy info).
-
processors
protected java.util.List<ITraverseProcessor> processors
The clone processors.
-
-
Constructor Detail
-
RemoteReferenceModule
public RemoteReferenceModule(IComponentIdentifier platform)
Create a new remote reference module.
-
-
Method Detail
-
getProxyReference
public jadex.bridge.component.impl.remotecommands.ProxyReference getProxyReference(java.lang.Object target, IComponentIdentifier tmpholder, java.lang.ClassLoader cl)Get a remote reference for a component for transport. (Called during marshalling from writer).
-
createProxyInfo
public static jadex.bridge.component.impl.remotecommands.ProxyInfo createProxyInfo(java.lang.Object target, java.lang.Class<?>[] remoteinterfaces, java.lang.ClassLoader cl, IComponentIdentifier platform)Create a proxy info for a service.
-
addCachedMethodValue
public static void addCachedMethodValue(jadex.bridge.component.impl.remotecommands.ProxyReference pr, jadex.bridge.component.impl.remotecommands.ProxyInfo pi, java.lang.reflect.Method m, java.lang.Object target)Add a cached method value to the proxy info.
-
getMethodInfo
public static MethodInfo[] getMethodInfo(java.lang.Object iden, java.lang.Class<?> targetclass, boolean noargs)
Get method info.
-
getRemoteReference
protected static jadex.bridge.component.impl.remotecommands.RemoteReference getRemoteReference(java.lang.Object target)
Get a remote reference.- Parameters:
target- The (local) remote object.
-
getRemoteReference
public static jadex.bridge.component.impl.remotecommands.RemoteReference getRemoteReference(java.lang.Object target, java.lang.Object orig)Get a remote reference.- Parameters:
target- The (local) remote object.
-
getTargetObject
public java.lang.Object getTargetObject(jadex.bridge.component.impl.remotecommands.RemoteReference rr)
Get a target object per remote reference.- Parameters:
rr- The remote reference.- Returns:
- The target object.
-
getProxy
public java.lang.Object getProxy(jadex.bridge.component.impl.remotecommands.ProxyReference pr, java.lang.ClassLoader classloader)Get a proxy for a proxy reference.- Parameters:
pr- The proxy reference.
-
isRemoteReference
public boolean isRemoteReference(java.lang.Object object)
Test if an object has reference semantics. It is a reference when: - it implements IRemotable - it is an IService, IExternalAccess or IFuture - if the object has used an @Reference annotation at type level - has been explicitly set to be reference
-
isRemoteObject
public boolean isRemoteObject(java.lang.Object target)
Test if an object is a remote object.
-
isReference
public boolean isReference(java.lang.Object object, boolean local)Test if an object has reference semantics. It is a reference when: - it implements IRemotable - it is an IService, IExternalAccess or IFuture, IIntermediateFuture, IResultListener, IIntermediateResultListener, IChangeListener, IRemoteChangeListener - if the object has used an @Reference annotation at type level
-
getRemoteInterfaces
public static java.lang.Class<?>[] getRemoteInterfaces(java.lang.Object object, java.lang.ClassLoader cl)Get the proxy interfaces (empty list if none).
-
isLocalReference
public boolean isLocalReference(java.lang.Object object)
Test if an object has reference semantics. It is a reference when: - it implements IRemotable - it is an IService, IExternalAccess or IFuture - if the object has used an @Reference annotation at type level - has been explicitly set to be reference
-
getCloneProcessors
public java.util.List<ITraverseProcessor> getCloneProcessors()
Get the clone processors.- Returns:
- The clone processors.
-
addCloneProcessor
public void addCloneProcessor(ITraverseProcessor proc)
Add a clone processor.
-
removeCloneProcessor
public void removeCloneProcessor(ITraverseProcessor proc)
Remove a clone processor.
-
-