com.sun.enterprise.deployment
Class MethodDescriptor

java.lang.Object
  extended by java.util.Observable
      extended by com.sun.enterprise.deployment.DynamicAttributesDescriptor
          extended by com.sun.enterprise.deployment.Descriptor
              extended by com.sun.enterprise.deployment.MethodDescriptor
All Implemented Interfaces:
java.io.Serializable

public final class MethodDescriptor
extends Descriptor

I am a deployment object representing a single method or a collection of methods on Enterprise Bean classes.

Author:
Danny Coward
See Also:
Serialized Form

Field Summary
static java.lang.String ALL_EJB_METHODS
          The method descriptor name representing all methods.
static java.lang.String ALL_METHODS
           
static java.lang.String ALL_OF_NAME
          Unused.
static java.lang.String EJB_BEAN
          Represents the bean class ejbClassSymbol.
static java.lang.String EJB_HOME
          Represents the bean home interface ejbClassSymbol.
static java.lang.String EJB_LOCAL
          Represents the local interface and no-interface view ejbClassSymbol.
static java.lang.String EJB_LOCALHOME
          Represents the bean local home interface ejbClassSymbol.
static java.lang.String EJB_REMOTE
          Represents the bean remote interface ejbClassSymbol.
static java.lang.String EJB_WEB_SERVICE
          Represents the web service interface ejbClassSymbol.
 
Fields inherited from class com.sun.enterprise.deployment.Descriptor
DESCRIPTION_CHANGED, DESCRIPTOR_CHANGED, docType, LARGE_ICON_CHANGED, NAME_CHANGED, SMALL_ICON_CHANGED
 
Constructor Summary
MethodDescriptor()
           
MethodDescriptor(java.lang.reflect.Method method)
          Construct an method descriptor from the given method object.
MethodDescriptor(java.lang.reflect.Method method, java.lang.String methodIntf)
          Construct an exact method descriptor from the given method object, classloader and ejb descriptor.
MethodDescriptor(java.lang.String name, java.lang.String description, java.lang.String ejbClassSymbol)
          Constructor for styles 2 and 1.
MethodDescriptor(java.lang.String name, java.lang.String description, java.lang.String[] parameterClassNames, java.lang.String ejbClassSymbol)
          Constructs a method descriptor corresponding to methods on the ejb class defined by the ejbClassSymbol (or home and remote if null) with the same name (or all if ALL_EJB_METHODS) and paramater list (or just all by name of this is null).
 
Method Summary
 void addParameterClass(java.lang.String parameter)
           
 java.util.Vector doStyleConversion(EjbDescriptor ejbDescriptor, java.util.Collection allMethods)
          Performs a conversion from the style1 style2 and style3 (no interface symbol) to method descriptors of style3 with an interface symbol.
 boolean equals(java.lang.Object other)
          Equlity iff the parameter names match and the name matches.
static java.lang.String fixParamClassName(java.lang.String param)
           
 java.lang.reflect.Method getDeclaredMethod(java.lang.Class declaringClass)
           
 java.lang.reflect.Method getDeclaredMethod(EjbDescriptor ejbDescriptor)
           
 java.lang.reflect.Method getDeclaredMethod(EjbDescriptor ejbDescriptor, java.lang.Class[] javaParamClassNames)
           
 java.lang.String getEjbClassSymbol()
          Returns the ejb class sybol for this method descriptor.
 java.lang.String getEjbName()
           
 java.lang.String getFormattedString()
           
 java.lang.String[] getJavaParameterClassNames()
           
static java.util.Map getJavaPrimitiveTypes()
          Computes the mapping between java primitive type and class loaders identifier for such types.
 java.lang.reflect.Method getMethod(java.lang.Class declaringClass)
           
 java.lang.reflect.Method getMethod(EjbDescriptor ejbDescriptor)
           
 java.lang.String[] getParameterClassNames()
           
 java.lang.String[] getParameterClassNamesFor(java.lang.reflect.Method method, java.lang.Class[] paramTypes)
           
 java.lang.String getPrettyParameterString()
           
 int getStyle()
          
 int hashCode()
           
 boolean implies(java.lang.Object other)
          Indicates if a method descriptor implies the other one
 boolean isExact()
          Returns true if I have enough information to specifiy a unique method on an ejb's home or remote interface unambiguously.
 java.lang.String prettyPrint()
           
 void print(java.lang.StringBuffer toStringBuffer)
          My pretty format.
 void setEjbClassSymbol(java.lang.String ejbClassSymbol)
          Sets the ejb class sybol for this method descriptor.
 void setEjbName(java.lang.String ejbName)
           
 void setEmptyParameterClassNames()
           
static java.lang.String xmlFormat2JavaClassNames(java.lang.String param)
           
 
Methods inherited from class com.sun.enterprise.deployment.Descriptor
addDeploymentExtension, addPrefixMapping, createUniqueFilenameAmongst, createUniqueNameAmongst, createUniqueNameAmongstNamedDescriptors, fillDocType, getDeploymentExtensions, getDescription, getDisplayName, getDocType, getLargeIconUri, getLocalizedDescription, getLocalizedDescriptions, getLocalizedDisplayName, getLocalizedDisplayNames, getLocalizedLargeIconUri, getLocalizedLargeIconUris, getLocalizedSmallIconUri, getLocalizedSmallIconUris, getName, getPrefixMapping, getSmallIconUri, isBoundsChecking, setBoundsChecking, setDescription, setDisplayName, setLargeIconUri, setLocalizedDescription, setLocalizedDisplayName, setLocalizedLargeIconUri, setLocalizedSmallIconUri, setName, setSmallIconUri, visit
 
Methods inherited from class com.sun.enterprise.deployment.DynamicAttributesDescriptor
addExtraAttribute, getExtraAttribute, getExtraAttributes, removeExtraAttribute, toString
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EJB_HOME

public static final java.lang.String EJB_HOME
Represents the bean home interface ejbClassSymbol.

See Also:
Constant Field Values

EJB_LOCALHOME

public static final java.lang.String EJB_LOCALHOME
Represents the bean local home interface ejbClassSymbol.

See Also:
Constant Field Values

EJB_REMOTE

public static final java.lang.String EJB_REMOTE
Represents the bean remote interface ejbClassSymbol.

See Also:
Constant Field Values

EJB_LOCAL

public static final java.lang.String EJB_LOCAL
Represents the local interface and no-interface view ejbClassSymbol.

See Also:
Constant Field Values

EJB_WEB_SERVICE

public static final java.lang.String EJB_WEB_SERVICE
Represents the web service interface ejbClassSymbol.

See Also:
Constant Field Values

EJB_BEAN

public static final java.lang.String EJB_BEAN
Represents the bean class ejbClassSymbol.

See Also:
Constant Field Values

ALL_OF_NAME

public static final java.lang.String ALL_OF_NAME
Unused.

See Also:
Constant Field Values

ALL_EJB_METHODS

public static final java.lang.String ALL_EJB_METHODS
The method descriptor name representing all methods.

See Also:
Constant Field Values

ALL_METHODS

public static final java.lang.String ALL_METHODS
See Also:
Constant Field Values
Constructor Detail

MethodDescriptor

public MethodDescriptor(java.lang.String name,
                        java.lang.String description,
                        java.lang.String[] parameterClassNames,
                        java.lang.String ejbClassSymbol)
Constructs a method descriptor corresponding to methods on the ejb class defined by the ejbClassSymbol (or home and remote if null) with the same name (or all if ALL_EJB_METHODS) and paramater list (or just all by name of this is null). (Styles 1 2 and 3 in the ejb specification)


MethodDescriptor

public MethodDescriptor(java.lang.String name,
                        java.lang.String description,
                        java.lang.String ejbClassSymbol)
Constructor for styles 2 and 1. Style 1 iff ALL_METHODS is used


MethodDescriptor

public MethodDescriptor(java.lang.reflect.Method method,
                        java.lang.String methodIntf)
Construct an exact method descriptor from the given method object, classloader and ejb descriptor.


MethodDescriptor

public MethodDescriptor(java.lang.reflect.Method method)
Construct an method descriptor from the given method object.


MethodDescriptor

public MethodDescriptor()
Method Detail

setEmptyParameterClassNames

public void setEmptyParameterClassNames()

addParameterClass

public void addParameterClass(java.lang.String parameter)

setEjbName

public void setEjbName(java.lang.String ejbName)

getEjbName

public java.lang.String getEjbName()

isExact

public boolean isExact()
Returns true if I have enough information to specifiy a unique method on an ejb's home or remote interface unambiguously.


getStyle

public int getStyle()

Returns:
the style level of this method descriptors. According to the J2EE spec, methods can be described byt using style 1, style 2 or style 3 xml tags.


getMethod

public java.lang.reflect.Method getMethod(EjbDescriptor ejbDescriptor)

getMethod

public java.lang.reflect.Method getMethod(java.lang.Class declaringClass)

getDeclaredMethod

public java.lang.reflect.Method getDeclaredMethod(java.lang.Class declaringClass)

getDeclaredMethod

public java.lang.reflect.Method getDeclaredMethod(EjbDescriptor ejbDescriptor)

getDeclaredMethod

public java.lang.reflect.Method getDeclaredMethod(EjbDescriptor ejbDescriptor,
                                                  java.lang.Class[] javaParamClassNames)

doStyleConversion

public java.util.Vector doStyleConversion(EjbDescriptor ejbDescriptor,
                                          java.util.Collection allMethods)
Performs a conversion from the style1 style2 and style3 (no interface symbol) to method descriptors of style3 with an interface symbol.


getEjbClassSymbol

public java.lang.String getEjbClassSymbol()
Returns the ejb class sybol for this method descriptor.


setEjbClassSymbol

public void setEjbClassSymbol(java.lang.String ejbClassSymbol)
Sets the ejb class sybol for this method descriptor.


getFormattedString

public java.lang.String getFormattedString()

getPrettyParameterString

public java.lang.String getPrettyParameterString()

getParameterClassNames

public java.lang.String[] getParameterClassNames()

getJavaParameterClassNames

public java.lang.String[] getJavaParameterClassNames()

equals

public boolean equals(java.lang.Object other)
Equlity iff the parameter names match and the name matches.

Overrides:
equals in class java.lang.Object

implies

public boolean implies(java.lang.Object other)
Indicates if a method descriptor implies the other one


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

print

public void print(java.lang.StringBuffer toStringBuffer)
My pretty format.

Overrides:
print in class Descriptor

prettyPrint

public java.lang.String prettyPrint()

getParameterClassNamesFor

public java.lang.String[] getParameterClassNamesFor(java.lang.reflect.Method method,
                                                    java.lang.Class[] paramTypes)

xmlFormat2JavaClassNames

public static java.lang.String xmlFormat2JavaClassNames(java.lang.String param)

getJavaPrimitiveTypes

public static java.util.Map getJavaPrimitiveTypes()
Computes the mapping between java primitive type and class loaders identifier for such types.

Returns:
the mapping with the java primitive type identifier as keys

fixParamClassName

public static java.lang.String fixParamClassName(java.lang.String param)


Copyright © 2012 GlassFish Community. All Rights Reserved.