Class RemoteReferenceModule


  • public class RemoteReferenceModule
    extends java.lang.Object
    This 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 IComponentIdentifier platform
      The platform cid.
      protected java.util.List<ITraverseProcessor> processors
      The clone processors.
      protected java.util.Map<java.lang.Object,​jadex.bridge.component.impl.remotecommands.ProxyInfo> proxyinfos
      The cache of proxy infos (class -> proxy info).
      protected java.util.Map<java.lang.Class<?>,​boolean[]> references
      The reference class cache (clazz->boolean (is reference)).
      static java.util.Map<java.lang.Class<?>,​boolean[]> REFERENCES
      The predefined reference settings (clazz->boolean (is reference)).
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      void addCloneProcessor​(ITraverseProcessor proc)
      Add a clone processor.
      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.
      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.Object getProxy​(jadex.bridge.component.impl.remotecommands.ProxyReference pr, java.lang.ClassLoader classloader)
      Get a proxy for a proxy reference.
      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.
      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.RemoteReference getRemoteReference​(java.lang.Object target)
      Get a remote reference.
      static jadex.bridge.component.impl.remotecommands.RemoteReference getRemoteReference​(java.lang.Object target, java.lang.Object orig)
      Get a remote reference.
      java.lang.Object getTargetObject​(jadex.bridge.component.impl.remotecommands.RemoteReference rr)
      Get a target object per remote reference.
      boolean isLocalReference​(java.lang.Object object)
      Test if an object has reference semantics.
      boolean isReference​(java.lang.Object object, boolean local)
      Test if an object has reference semantics.
      boolean isRemoteObject​(java.lang.Object target)
      Test if an object is a remote object.
      boolean isRemoteReference​(java.lang.Object object)
      Test if an object has reference semantics.
      void removeCloneProcessor​(ITraverseProcessor proc)
      Remove a clone processor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • REFERENCES

        public static final java.util.Map<java.lang.Class<?>,​boolean[]> REFERENCES
        The predefined reference settings (clazz->boolean (is reference)).
      • 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.