Package org.glassfish.rmic
Class RemoteClass.Method
- java.lang.Object
-
- org.glassfish.rmic.RemoteClass.Method
-
- All Implemented Interfaces:
java.lang.Cloneable
- Enclosing class:
- RemoteClass
public class RemoteClass.Method extends java.lang.Object implements java.lang.CloneableA 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[]exceptionsExceptions declared to be thrown by this remote method.private MemberDefinitionmemberDefMember definition for this method, from one of the remote interfaces that this method was found in.private longmethodHashstub "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.Objectclone()Cloning is supported by returning a shallow copy of this object.private voidcollectCompatibleExceptions(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 longcomputeMethodHash()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.MemberDefinitiongetMemberDefinition()Return the definition of the actual class member corresponing to this method of a remote interface.longgetMethodHash()Return the "method hash" used to identify this remote method in the JDK 1.2 version of the stub protocol.IdentifiergetName()Return the name of this method.java.lang.StringgetNameAndDescriptor()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.StringgetOperationString()Return the string representation of this method appropriate for the construction of a java.rmi.server.Operation object.TypegetType()Return the type of this method.private RemoteClass.MethodmergeWith(RemoteClass.Method other)Return a new Method object that is a legal combination of this method object and another one.java.lang.StringtoString()Return the string representation of this method.
-
-
-
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:
toStringin classjava.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:
clonein classjava.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.
-
collectCompatibleExceptions
private void collectCompatibleExceptions(ClassDeclaration[] from, ClassDeclaration[] with, java.util.Vector<ClassDeclaration> list) throws ClassNotFound
Add to the supplied list all exceptions in the "from" array that are subclasses of an exception in the "with" array.- Throws:
ClassNotFound
-
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?
-
-