Class RemoteMethodInvocationHandler

  • All Implemented Interfaces:
    ISwitchCall, java.lang.reflect.InvocationHandler

    public class RemoteMethodInvocationHandler
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler, ISwitchCall
    Class that implements the Java proxy InvocationHandler, which is called when a method on a proxy is called.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected IInternalAccess comp
      The local component.
      protected jadex.bridge.component.impl.remotecommands.ProxyReference pr
      The proxy reference.
    • Field Detail

      • pr

        protected jadex.bridge.component.impl.remotecommands.ProxyReference pr
        The proxy reference.
    • Constructor Detail

      • RemoteMethodInvocationHandler

        public RemoteMethodInvocationHandler​(IInternalAccess comp,
                                             jadex.bridge.component.impl.remotecommands.ProxyReference pr)
        Create a new invocation handler.
    • Method Detail

      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Invoke a method.
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable
      • getProxyReference

        public jadex.bridge.component.impl.remotecommands.ProxyReference getProxyReference()
        Get the pr.
        Returns:
        the pr.
      • isSwitchCall

        public boolean isSwitchCall()
        Check if a switch call should be done.
        Specified by:
        isSwitchCall in interface ISwitchCall
        Returns:
        True, if switch should be done.
      • equals

        public boolean equals​(java.lang.Object obj)
        Test equality.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Hash code.
        Overrides:
        hashCode in class java.lang.Object
      • createRemoteServiceProxy

        public static IService createRemoteServiceProxy​(IInternalAccess localcomp,
                                                        IServiceIdentifier remotesvc)
        Create a proxy object for a remote service.
        Parameters:
        localcomp - The local component for sending/receiving messages.
        remotesvc - ID of the remote service.