Package com.sun.enterprise.deployment
Class MethodDescriptor
- java.lang.Object
-
- java.util.Observable
-
- org.glassfish.deployment.common.DynamicAttributesDescriptor
-
- org.glassfish.deployment.common.Descriptor
-
- com.sun.enterprise.deployment.MethodDescriptor
-
- All Implemented Interfaces:
Serializable
public final class MethodDescriptor extends Descriptor
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
Fields Modifier and Type Field Description static String
ALL_METHODS
The method descriptor name representing all methods.static String
ALL_OF_NAME
Unused.static String
EJB_BEAN
Represents the bean class ejbClassSymbol.static String
EJB_HOME
Represents the bean home interface ejbClassSymbol.static String
EJB_LOCAL
Represents the local interface and no-interface view ejbClassSymbol.static String
EJB_LOCALHOME
Represents the bean local home interface ejbClassSymbol.static String
EJB_REMOTE
Represents the bean remote interface ejbClassSymbol.static String
EJB_WEB_SERVICE
Represents the web service interface ejbClassSymbol.static String
LIFECYCLE_CALLBACK
Represents the bean lifecycle methods ejbClassSymbol.static String
MESSAGE_ENDPOINT_METHOD
Represents the bean MessageEndpoint methods ejbClassSymbol.static String
TIMER_METHOD
Represents the bean timeout methods ejbClassSymbol.-
Fields inherited from class org.glassfish.deployment.common.Descriptor
DESCRIPTION_CHANGED, DESCRIPTOR_CHANGED, docType, LARGE_ICON_CHANGED, NAME_CHANGED, SMALL_ICON_CHANGED
-
-
Constructor Summary
Constructors Constructor Description MethodDescriptor()
MethodDescriptor(Method method)
Construct an method descriptor from the given method object.MethodDescriptor(Method method, String methodIntf)
Construct an exact method descriptor from the given method object, classloader and ejb descriptor.MethodDescriptor(String name, String description, String ejbClassSymbol)
Constructor for styles 2 and 1.MethodDescriptor(String name, String description, String[] parameterClassNames, 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_METHODS) and paramater list (or just all by name of this is null).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameterClass(String parameter)
Vector
doStyleConversion(EjbDescriptor ejbDescriptor, 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(Object other)
Equlity iff the parameter names match and the name matches.static String
fixParamClassName(String param)
Method
getDeclaredMethod(EjbDescriptor ejbDescriptor)
Method
getDeclaredMethod(EjbDescriptor ejbDescriptor, Class[] javaParamClassNames)
Method
getDeclaredMethod(Class declaringClass)
String
getEjbClassSymbol()
Returns the ejb class sybol for this method descriptor.String
getEjbName()
String
getFormattedString()
String[]
getJavaParameterClassNames()
static Map
getJavaPrimitiveTypes()
Computes the mapping between java primitive type and class loaders identifier for such types.Method
getMethod(EjbDescriptor ejbDescriptor)
Method
getMethod(Class declaringClass)
String[]
getParameterClassNames()
String[]
getParameterClassNamesFor(Method method, Class[] paramTypes)
String
getPrettyParameterString()
int
getStyle()
int
hashCode()
boolean
implies(Object other)
Indicates if a method descriptor implies the other oneboolean
isExact()
Returns true if I have enough information to specifiy a unique method on an ejb's home or remote interface unambiguously.String
prettyPrint()
void
print(StringBuilder toStringBuilder)
My pretty format.void
setEjbClassSymbol(String ejbClassSymbol)
Sets the ejb class sybol for this method descriptor.void
setEjbName(String ejbName)
void
setEmptyParameterClassNames()
static String
xmlFormat2JavaClassNames(String param)
-
Methods inherited from class org.glassfish.deployment.common.Descriptor
addDescriptorExtension, addPrefixMapping, createUniqueFilenameAmongst, createUniqueNameAmongst, createUniqueNameAmongstNamedDescriptors, fillDocType, getDeploymentExtensions, getDescription, getDescriptorExtension, getDescriptorExtensions, 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 org.glassfish.deployment.common.DynamicAttributesDescriptor
addExtraAttribute, getExtraAttribute, getExtraAttributes, removeExtraAttribute, toString
-
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
-
-
-
Field Detail
-
EJB_HOME
public static final String EJB_HOME
Represents the bean home interface ejbClassSymbol.- See Also:
- Constant Field Values
-
EJB_LOCALHOME
public static final String EJB_LOCALHOME
Represents the bean local home interface ejbClassSymbol.- See Also:
- Constant Field Values
-
EJB_REMOTE
public static final String EJB_REMOTE
Represents the bean remote interface ejbClassSymbol.- See Also:
- Constant Field Values
-
EJB_LOCAL
public static final String EJB_LOCAL
Represents the local interface and no-interface view ejbClassSymbol.- See Also:
- Constant Field Values
-
EJB_WEB_SERVICE
public static final String EJB_WEB_SERVICE
Represents the web service interface ejbClassSymbol.- See Also:
- Constant Field Values
-
EJB_BEAN
public static final String EJB_BEAN
Represents the bean class ejbClassSymbol.- See Also:
- Constant Field Values
-
ALL_OF_NAME
public static final String ALL_OF_NAME
Unused.- See Also:
- Constant Field Values
-
ALL_METHODS
public static final String ALL_METHODS
The method descriptor name representing all methods.- See Also:
- Constant Field Values
-
TIMER_METHOD
public static final String TIMER_METHOD
Represents the bean timeout methods ejbClassSymbol.- See Also:
- Constant Field Values
-
LIFECYCLE_CALLBACK
public static final String LIFECYCLE_CALLBACK
Represents the bean lifecycle methods ejbClassSymbol.- See Also:
- Constant Field Values
-
MESSAGE_ENDPOINT_METHOD
public static final String MESSAGE_ENDPOINT_METHOD
Represents the bean MessageEndpoint methods ejbClassSymbol.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MethodDescriptor
public MethodDescriptor(String name, String description, String[] parameterClassNames, 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_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(String name, String description, String ejbClassSymbol)
Constructor for styles 2 and 1. Style 1 iff ALL_METHODS is used
-
MethodDescriptor
public MethodDescriptor(Method method, String methodIntf)
Construct an exact method descriptor from the given method object, classloader and ejb descriptor.
-
MethodDescriptor
public MethodDescriptor(Method method)
Construct an method descriptor from the given method object.
-
MethodDescriptor
public MethodDescriptor()
-
-
Method Detail
-
setEmptyParameterClassNames
public void setEmptyParameterClassNames()
-
addParameterClass
public void addParameterClass(String parameter)
-
setEjbName
public void setEjbName(String ejbName)
-
getEjbName
public 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 Method getMethod(EjbDescriptor ejbDescriptor)
-
getDeclaredMethod
public Method getDeclaredMethod(EjbDescriptor ejbDescriptor)
-
getDeclaredMethod
public Method getDeclaredMethod(EjbDescriptor ejbDescriptor, Class[] javaParamClassNames)
-
doStyleConversion
public Vector doStyleConversion(EjbDescriptor ejbDescriptor, 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 String getEjbClassSymbol()
Returns the ejb class sybol for this method descriptor.
-
setEjbClassSymbol
public void setEjbClassSymbol(String ejbClassSymbol)
Sets the ejb class sybol for this method descriptor.
-
getFormattedString
public String getFormattedString()
-
getPrettyParameterString
public String getPrettyParameterString()
-
getParameterClassNames
public String[] getParameterClassNames()
-
getJavaParameterClassNames
public String[] getJavaParameterClassNames()
-
equals
public boolean equals(Object other)
Equlity iff the parameter names match and the name matches.
-
implies
public boolean implies(Object other)
Indicates if a method descriptor implies the other one
-
print
public void print(StringBuilder toStringBuilder)
My pretty format.- Overrides:
print
in classDescriptor
-
prettyPrint
public String prettyPrint()
-
getParameterClassNamesFor
public String[] getParameterClassNamesFor(Method method, Class[] paramTypes)
-
getJavaPrimitiveTypes
public static 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
-
-