Package org.glassfish.rmic
Class RemoteClass.Method
java.lang.Object
org.glassfish.rmic.RemoteClass.Method
- All Implemented Interfaces:
Cloneable
- Enclosing class:
RemoteClass
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
FieldsModifier and TypeFieldDescriptionprivate ClassDeclaration[]
Exceptions declared to be thrown by this remote method.private MemberDefinition
Member definition for this method, from one of the remote interfaces that this method was found in.private long
stub "method hash" to identify this method -
Constructor Summary
ConstructorsConstructorDescriptionMethod
(MemberDefinition memberDef) Create a new Method object corresponding to the given method definition. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
clone()
Cloning is supported by returning a shallow copy of this object.private void
collectCompatibleExceptions
(ClassDeclaration[] from, ClassDeclaration[] with, 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
Compute the "method hash" of this remote method.Return an array of the exception classes declared to be thrown by this remote method.Return the definition of the actual class member corresponing to this method of a remote interface.long
Return the "method hash" used to identify this remote method in the JDK 1.2 version of the stub protocol.getName()
Return the name of this method.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).Return the string representation of this method appropriate for the construction of a java.rmi.server.Operation object.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.toString()
Return the string representation of this method.
-
Field Details
-
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 methodHashstub "method hash" to identify this method -
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 Details
-
Method
Method(MemberDefinition memberDef) Create a new Method object corresponding to the given method definition.
-
-
Method Details
-
getMemberDefinition
Return the definition of the actual class member corresponing to this method of a remote interface. REMIND: Can this method be removed? -
getName
Return the name of this method. -
getType
Return the type of this method. -
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
Return the string representation of this method. -
getOperationString
Return the string representation of this method appropriate for the construction of a java.rmi.server.Operation object. -
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
Cloning is supported by returning a shallow copy of this object. -
mergeWith
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, 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?
-