org.glassfish.admin.amx.intf.config
Class AMXConfigHelper

java.lang.Object
  extended by org.glassfish.admin.amx.intf.config.AMXConfigHelper

@Taxonomy(stability=UNCOMMITTED)
public class AMXConfigHelper
extends Object

Various shortcut methods for working with AMX config MBeans, particularly attributes and metadata.

Author:
llc

Constructor Summary
AMXConfigHelper(AMXConfigProxy amx)
           
 
Method Summary
 Descriptor attributeDescriptor(String attrName)
          Get the JMX Descriptor for an Attribute.
 Object attributeDescriptorField(String attrName, String fieldName)
          Get the field value for an Attribute and specified field name, if any.
 Set<String> attributeNamesByDescriptorField(String fieldName, String value)
          match all attributes that have a Descriptor field with the specified value.
 String dataType(String attrName)
          Return the dataType (if any) for the specified attribute eg java.lang.Boolean,
 String defaultValue(String attrName)
          Return the default value of the attribute, or null if no default value.
 boolean key(String attrName)
          return true if the Attribute is a key value
 Long max(String attrName)
          Return the maximum value (if any) for the specified numeric attribute.
 Long min(String attrName)
          Return the minimum value (if any) for the specified numeric attribute.
 boolean notNull(String attrName)
          return true if the Attribute may not be null (is required)
 String regexPattern(String attrName)
          Return the regex pattern (if any) for the specified attribute.
 Boolean required(String attrName)
          Return whether the attribute is required.
 Set<String> simpleAttributes()
          Get simple attribute names; those that are not Element kind.
 Map<String,Object> simpleAttributesMap()
          Get simple attributes; those that are not Element kind.
 String units(String attrName)
          Return the units (if any) for the specified attribute.
 String xmlName(String attrName)
          Return the xml name of the attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AMXConfigHelper

public AMXConfigHelper(AMXConfigProxy amx)
Method Detail

attributeNamesByDescriptorField

public Set<String> attributeNamesByDescriptorField(String fieldName,
                                                   String value)
match all attributes that have a Descriptor field with the specified value. (could be extended to use regexp for value and/or field name).

Parameters:
amx - the proxy
fieldName - name of the field in the Descriptor for each Attribute
value - value of the field in the Descriptor for each Attribute

simpleAttributes

public Set<String> simpleAttributes()
Get simple attribute names; those that are not Element kind.


simpleAttributesMap

public Map<String,Object> simpleAttributesMap()
Get simple attributes; those that are not Element kind.


attributeDescriptor

public final Descriptor attributeDescriptor(String attrName)
Get the JMX Descriptor for an Attribute.

See Also:
AMXConfigConstants

attributeDescriptorField

public final Object attributeDescriptorField(String attrName,
                                             String fieldName)
Get the field value for an Attribute and specified field name, if any.

Parameters:
attrName -
fieldName -
See Also:
AMXConfigConstants

units

public String units(String attrName)
Return the units (if any) for the specified attribute.

Parameters:
attrName -

min

public Long min(String attrName)
Return the minimum value (if any) for the specified numeric attribute.

Parameters:
attrName -

max

public Long max(String attrName)
Return the maximum value (if any) for the specified numeric attribute.

Parameters:
attrName -

dataType

public String dataType(String attrName)
Return the dataType (if any) for the specified attribute eg java.lang.Boolean,

Parameters:
attrName - java.lang.Integer, java.lang.Long, java.lang.String

regexPattern

public String regexPattern(String attrName)
Return the regex pattern (if any) for the specified attribute.

Parameters:
attrName -

key

public boolean key(String attrName)
return true if the Attribute is a key value

Parameters:
attrName -

notNull

public boolean notNull(String attrName)
return true if the Attribute may not be null (is required)

Parameters:
attrName -

required

public Boolean required(String attrName)
Return whether the attribute is required. This can be implied by several different annotations or field; this method checks them all.

Parameters:
attrName -

xmlName

public String xmlName(String attrName)
Return the xml name of the attribute.

Parameters:
attrName -

defaultValue

public String defaultValue(String attrName)
Return the default value of the attribute, or null if no default value.

Parameters:
attrName -


Copyright © 2012 GlassFish Community. All Rights Reserved.