JBossMX Parent POM 6.0.0.GA

org.jboss.mx.metadata
Class MethodMapper

java.lang.Object
  extended by org.jboss.mx.metadata.MethodMapper

public class MethodMapper
extends Object

Helper class for resolving JMX *Info objects against Method objects. It's typically used during the construction of dispatchers during MBean registration/creation. If you're looking for a fast resolver of JMX operation signatures see AttributeOperationResolver. FIXME - this class is not aware of multiple target objects (as in modelmbeans) however I'm half expecting that feature to disappear in JMX 1.1 anyhow.

Author:
Trevor Squires.

Constructor Summary
MethodMapper(Class resourceClass)
          Constructs a mapper by reflecting on the class.
 
Method Summary
protected  HashMap createMap(Class resourceClass)
          creates the signature string to Method HashMap.
static String getterSignature(MBeanAttributeInfo info)
          Generates a signature string for an attribute getter method using standard rules
static String getterSignature(ModelMBeanAttributeInfo info)
          Generates a getter signature string for a ModelMBean attribute by checking the descriptor for getMethod.
 Method lookupGetter(MBeanAttributeInfo info)
          Return a method matching the getter signature expected for an attribute.
 Method lookupGetter(ModelMBeanAttributeInfo info)
          Return a method matching the getter signature expected for a ModelMBean attribute.
 Method lookupMethod(String returnType, String name, String[] signature)
          Return a method matching the specified signature
 Method lookupOperation(MBeanOperationInfo info)
          Return a method matching the signature defined in the operation info
 Method lookupSetter(MBeanAttributeInfo info)
          Return a method matching the setter signature expected for an attribute
 Method lookupSetter(ModelMBeanAttributeInfo info)
          Return a method matching the setter signature expected for a ModelMBean attribute
static String methodSignature(Method method)
          Generates a signature string using a Method object.
static String methodSignature(String returnType, String name, String[] signature)
          Generates a signature string using the supplied signature arguments.
static String operationSignature(MBeanOperationInfo info)
          Generates a signature string using the operation info.
static String setterSignature(MBeanAttributeInfo info)
          Generates a signature string for an attribute setter method using standard rules
static String setterSignature(ModelMBeanAttributeInfo info)
          Generates a setter signature string for a ModelMBean attribute by checking the descriptor for setMethod.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodMapper

public MethodMapper(Class resourceClass)
Constructs a mapper by reflecting on the class.

Parameters:
resourceClass - the resource class
Method Detail

lookupOperation

public Method lookupOperation(MBeanOperationInfo info)
Return a method matching the signature defined in the operation info

Parameters:
info - the operation info
Returns:
the method

lookupGetter

public Method lookupGetter(MBeanAttributeInfo info)
Return a method matching the getter signature expected for an attribute.

Parameters:
info - the attribute info
Returns:
the method

lookupGetter

public Method lookupGetter(ModelMBeanAttributeInfo info)
Return a method matching the getter signature expected for a ModelMBean attribute.

Parameters:
info - the attribute info
Returns:
the method

lookupSetter

public Method lookupSetter(MBeanAttributeInfo info)
Return a method matching the setter signature expected for an attribute

Parameters:
info - the attribute info
Returns:
the method

lookupSetter

public Method lookupSetter(ModelMBeanAttributeInfo info)
Return a method matching the setter signature expected for a ModelMBean attribute

Parameters:
info - the attribute info
Returns:
the method

lookupMethod

public Method lookupMethod(String returnType,
                           String name,
                           String[] signature)
Return a method matching the specified signature

Parameters:
returnType - the return type
name - the name
signature - the signature
Returns:
the method

getterSignature

public static String getterSignature(MBeanAttributeInfo info)
Generates a signature string for an attribute getter method using standard rules

Parameters:
info - the attribute info
Returns:
the signature

getterSignature

public static String getterSignature(ModelMBeanAttributeInfo info)
Generates a getter signature string for a ModelMBean attribute by checking the descriptor for getMethod.

Parameters:
info - the attribute info
Returns:
the signature

setterSignature

public static String setterSignature(MBeanAttributeInfo info)
Generates a signature string for an attribute setter method using standard rules

Parameters:
info - the attribute info
Returns:
the signature

setterSignature

public static String setterSignature(ModelMBeanAttributeInfo info)
Generates a setter signature string for a ModelMBean attribute by checking the descriptor for setMethod.

Parameters:
info - the attribute info
Returns:
the signature

operationSignature

public static String operationSignature(MBeanOperationInfo info)
Generates a signature string using the operation info.

Parameters:
info - the operation info
Returns:
the signature

methodSignature

public static String methodSignature(Method method)
Generates a signature string using a Method object.

Parameters:
method - the method
Returns:
the signature

methodSignature

public static String methodSignature(String returnType,
                                     String name,
                                     String[] signature)
Generates a signature string using the supplied signature arguments.

Parameters:
returnType - the return type
name - the name
signature - the signature
Returns:
the signature

createMap

protected HashMap createMap(Class resourceClass)
creates the signature string to Method HashMap.

Parameters:
resourceClass - the resource class
Returns:
the map

JBossMX Parent POM 6.0.0.GA

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.