Class RemoteClass.Method

  • All Implemented Interfaces:
    java.lang.Cloneable
    Enclosing class:
    RemoteClass

    public class RemoteClass.Method
    extends java.lang.Object
    implements java.lang.Cloneable
    A RemoteClass.Method object encapsulates RMI-specific information about a particular remote method in the remote implementation class represented by the outer instance.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ClassDeclaration[] exceptions
      Exceptions declared to be thrown by this remote method.
      private MemberDefinition memberDef
      Member definition for this method, from one of the remote interfaces that this method was found in.
      private long methodHash
      stub "method hash" to identify this method
    • Constructor Summary

      Constructors 
      Constructor Description
      Method​(MemberDefinition memberDef)
      Create a new Method object corresponding to the given method definition.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object clone()
      Cloning is supported by returning a shallow copy of this object.
      private void collectCompatibleExceptions​(ClassDeclaration[] from, ClassDeclaration[] with, java.util.Vector<ClassDeclaration> list)
      Add to the supplied list all exceptions in the "from" array that are subclasses of an exception in the "with" array.
      private long computeMethodHash()
      Compute the "method hash" of this remote method.
      ClassDeclaration[] getExceptions()
      Return an array of the exception classes declared to be thrown by this remote method.
      MemberDefinition getMemberDefinition()
      Return the definition of the actual class member corresponing to this method of a remote interface.
      long getMethodHash()
      Return the "method hash" used to identify this remote method in the JDK 1.2 version of the stub protocol.
      Identifier getName()
      Return the name of this method.
      java.lang.String getNameAndDescriptor()
      Return a string consisting of this method's name followed by its method descriptor, using the Java VM's notation for method descriptors (see section 4.3.3 of The Java Virtual Machine Specification).
      java.lang.String getOperationString()
      Return the string representation of this method appropriate for the construction of a java.rmi.server.Operation object.
      Type getType()
      Return the type of this method.
      private RemoteClass.Method mergeWith​(RemoteClass.Method other)
      Return a new Method object that is a legal combination of this method object and another one.
      java.lang.String toString()
      Return the string representation of this method.
      • Methods inherited from class java.lang.Object

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

      • memberDef

        private MemberDefinition memberDef
        Member definition for this method, from one of the remote interfaces that this method was found in. Note that this member definition may be only one of several member defintions that correspond to this remote method object, if several of this class's remote interfaces contain methods with the same name and type signature. Therefore, this member definition may declare more exceptions thrown that this remote method does.
      • methodHash

        private long methodHash
        stub "method hash" to identify this method
      • exceptions

        private ClassDeclaration[] exceptions
        Exceptions declared to be thrown by this remote method. This list can include superfluous entries, such as unchecked exceptions and subclasses of other entries.
    • Constructor Detail

      • Method

        Method​(MemberDefinition memberDef)
        Create a new Method object corresponding to the given method definition.
    • Method Detail

      • getMemberDefinition

        public MemberDefinition getMemberDefinition()
        Return the definition of the actual class member corresponing to this method of a remote interface. REMIND: Can this method be removed?
      • getName

        public Identifier getName()
        Return the name of this method.
      • getType

        public Type getType()
        Return the type of this method.
      • getExceptions

        public ClassDeclaration[] getExceptions()
        Return an array of the exception classes declared to be thrown by this remote method. For methods with the same name and type signature inherited from multiple remote interfaces, the array will contain the set of exceptions declared in all of the interfaces' methods that can be legally thrown in each of them.
      • getMethodHash

        public long getMethodHash()
        Return the "method hash" used to identify this remote method in the JDK 1.2 version of the stub protocol.
      • toString

        public java.lang.String toString()
        Return the string representation of this method.
        Overrides:
        toString in class java.lang.Object
      • getOperationString

        public java.lang.String getOperationString()
        Return the string representation of this method appropriate for the construction of a java.rmi.server.Operation object.
      • getNameAndDescriptor

        public java.lang.String getNameAndDescriptor()
        Return a string consisting of this method's name followed by its method descriptor, using the Java VM's notation for method descriptors (see section 4.3.3 of The Java Virtual Machine Specification).
      • clone

        protected java.lang.Object clone()
        Cloning is supported by returning a shallow copy of this object.
        Overrides:
        clone in class java.lang.Object
      • mergeWith

        private RemoteClass.Method mergeWith​(RemoteClass.Method other)
        Return a new Method object that is a legal combination of this method object and another one. This requires determining the exceptions declared by the combined method, which must be (only) all of the exceptions declared in both old Methods that may thrown in either of them.
      • computeMethodHash

        private long computeMethodHash()
        Compute the "method hash" of this remote method. The method hash is a long containing the first 64 bits of the SHA digest from the UTF encoded string of the method name and descriptor. REMIND: Should this method share implementation code with the outer class's computeInterfaceHash() method?