Following up on my previous message on AMX MBeans, here is a handy
tool for getting a java interface from an MBean.
The Tools MBean (Object is "v3:pp=/,type=tools") has a number of
methods for displaying and validating AMX MBeans, including their
metadata.
Here are a few examples, using my jmxcmd command line.
# display info on the MBean whose type is 'property'
jmxcmd> infoType:property
invoking infoType(property) on type=tools
---v3:pp=/,type=tools---
MBeanInfo for v3:pp=/domain/configs/config[server-config]/security-
service/message-security-config[SOAP]/provider-
config[XWS_ClientProvider],type=property,name=encryption.key.alias
package mbeans.generated;
import java.util.Map;
import javax.management.AttributeList;
import javax.management.ObjectName;
/**
Implementing class: org.glassfish.api.admin.config.Property
amx.genericInterfaceName =
org.glassfish.admin.amx.config.AMXConfigProxy
amx.group = config
amx.isSingleton = false
amx.subTypes = {}
amx.supportsAdoption = false
immutableInfo = true
interfaceName = org.glassfish.admin.amx.intf.config.PropertyConfig
*/
public interface org_glassfish_api_admin_config_Property_Proxy
{
/**
@Attribute Description
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:dataType =
class java.lang.String
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:defaultValue =
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:key
= false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:reference =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:required =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:value =
amx
.configbean
.annotation._at_org.jvnet.hk2.config.Attribute:variableExpansion = true
amx.configbean.dataType = java.lang.String
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Attribute
amx.configbean.notNull = false
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = description
*/
public String getDescription();
public void setDescription( String value );
/**
Name of this MBean, can differ from name in ObjectName
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:dataType =
class java.lang.String
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:defaultValue =
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:key
= true
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:reference =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:required =
true
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:value =
amx
.configbean
.annotation._at_org.jvnet.hk2.config.Attribute:variableExpansion = true
amx.configbean.dataType = java.lang.String
amx.configbean.key = true
amx.configbean.kind = org.jvnet.hk2.config.Attribute
amx.configbean.notNull = false
amx.configbean.reference = false
amx.configbean.required = true
amx.configbean.variableExpansion = true
amx.configbean.xmlName = name
*/
public String getName();
/**
Parent of this MBean, non-null except for DomainRoot
*/
public ObjectName getParent();
/**
@Attribute Value
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:dataType =
class java.lang.String
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:defaultValue =
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:key
= false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:reference =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:required =
true
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:value =
amx
.configbean
.annotation._at_org.jvnet.hk2.config.Attribute:variableExpansion = true
amx.configbean.dataType = java.lang.String
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Attribute
amx.configbean.notNull = false
amx.configbean.reference = false
amx.configbean.required = true
amx.configbean.variableExpansion = true
amx.configbean.xmlName = value
*/
public String getValue();
public void setValue( String value );
// -------------------- Operations --------------------
/**
@param childType
@param params name/value pairs, even entries are names, odd
entries are values
@return ObjectName
*/
public ObjectName createChild( String childType, Object[] params );
/**
Create a child of the specified type
@param childType
@param params name/value pairs for attributes
@return ObjectName
*/
public ObjectName createChild( String childType, Map params );
/**
Get the available default values
@param useAMXAttributeName true to use Attribute names, false
to use XML names
@return Map
*/
public Map getDefaultValues( boolean useAMXAttributeName );
/**
Get the default values for child type
@param type
@param useAMXAttributeName true to use Attribute names, false
to use XML names
@return Map
*/
public Map getDefaultValues( String type, boolean
useAMXAttributeName );
/**
@DuckTyped getParent of org.glassfish.api.admin.config.Property
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@return ObjectName
*/
public ObjectName getParent();
/**
@param childType
*/
public void removeChild( String childType );
/**
@param childType
@param name
*/
public void removeChild( String childType, String name );
/**
Get and resolve a (possible) ${...} attribute to a real value
@param attributeName
@return String
*/
public String resolveAttribute( String attributeName );
/**
Resolve a (possible) ${...} attribute *value* to a real value
@param value
@return String
*/
public String resolveAttributeValue( String value );
/**
Get and resolve attributes to values
@param attributeNames
@return AttributeList
*/
public AttributeList resolveAttributes( String[] attributeNames );
/**
Get and resolve a (possible) ${...} attribute to a Boolean,
returns null if not found
@param attributeName
@return Boolean
*/
public Boolean resolveBoolean( String attributeName );
/**
Get and resolve a (possible) ${...} attribute to a Long,
returns null if not found
@param attributeName
@return Long
*/
public Long resolveLong( String attributeName );
}
Matched 45 mbean(s).
# display info for a path
jmxcmd> infoPath:/domain
invoking infoPath(/domain) on type=tools
---v3:pp=/,type=tools---
MBeanInfo for v3:pp=/,type=domain
package mbeans.generated;
import java.util.Map;
import java.util.List;
import javax.management.AttributeList;
import javax.management.ObjectName;
/**
Implementing class: com.sun.enterprise.config.serverbeans.Domain
amx.genericInterfaceName =
org.glassfish.admin.amx.config.AMXConfigProxy
amx.group = config
amx.isSingleton = true
amx.subTypes = {configs,resources,load-balancers,lb-
configs,clusters,servers,node-agents,property,system-
property,applications,system-applications}
amx.supportsAdoption = false
immutableInfo = true
interfaceName = org.glassfish.admin.amx.intf.config.DomainConfig
*/
public interface com_sun_enterprise_config_serverbeans_Domain_Proxy
{
/**
@Attribute ApplicationRoot
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:dataType =
class java.lang.String
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:defaultValue =
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:key
= false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:reference =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:required =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:value =
amx
.configbean
.annotation._at_org.jvnet.hk2.config.Attribute:variableExpansion = true
amx.configbean.dataType = java.lang.String
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Attribute
amx.configbean.notNull = false
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = application-root
*/
public String getApplicationRoot();
public void setApplicationRoot( String value );
/**
@Element Applications of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = javax.management.ObjectName
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = applications
*/
public ObjectName getApplications();
public void setApplications( ObjectName value );
/**
Children of this MBean, in no particular order
*/
public javax.management.ObjectName[] getChildren();
/**
@Element Clusters of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = javax.management.ObjectName
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = clusters
*/
public ObjectName getClusters();
public void setClusters( ObjectName value );
/**
@Element Configs of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = javax.management.ObjectName
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = true
amx.configbean.variableExpansion = true
amx.configbean.xmlName = configs
*/
public ObjectName getConfigs();
public void setConfigs( ObjectName value );
/**
@Element LbConfigs of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = javax.management.ObjectName
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = lb-configs
*/
public ObjectName getLbConfigs();
public void setLbConfigs( ObjectName value );
/**
@Element LoadBalancers of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = javax.management.ObjectName
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = load-balancers
*/
public ObjectName getLoadBalancers();
public void setLoadBalancers( ObjectName value );
/**
@Attribute Locale
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:dataType =
class java.lang.String
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:defaultValue =
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:key
= false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:reference =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:required =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:value =
amx
.configbean
.annotation._at_org.jvnet.hk2.config.Attribute:variableExpansion = true
amx.configbean.dataType = java.lang.String
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Attribute
amx.configbean.notNull = false
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = locale
*/
public String getLocale();
public void setLocale( String value );
/**
@Attribute LogRoot
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:dataType =
class java.lang.String
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:defaultValue =
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:key
= false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:reference =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:required =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:value =
amx
.configbean
.annotation._at_org.jvnet.hk2.config.Attribute:variableExpansion = true
amx.configbean.dataType = java.lang.String
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Attribute
amx.configbean.notNull = false
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = log-root
*/
public String getLogRoot();
public void setLogRoot( String value );
/**
Name of this MBean, can differ from name in ObjectName
*/
public String getName();
/**
@Element NodeAgents of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = javax.management.ObjectName
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = node-agents
*/
public ObjectName getNodeAgents();
public void setNodeAgents( ObjectName value );
/**
Parent of this MBean, non-null except for DomainRoot
*/
public ObjectName getParent();
/**
@Element Property of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = [Ljavax.management.ObjectName;
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.toDo = IMPORTANT, Provide PropertyDesc for
legal props
amx.configbean.variableExpansion = true
amx.configbean.xmlName = property
*/
public javax.management.ObjectName[] getProperty();
public void setProperty( javax.management.ObjectName[] value );
/**
@Element Resources of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = javax.management.ObjectName
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = resources
*/
public ObjectName getResources();
public void setResources( ObjectName value );
/**
@Element Servers of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = javax.management.ObjectName
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = true
amx.configbean.variableExpansion = true
amx.configbean.xmlName = servers
*/
public ObjectName getServers();
public void setServers( ObjectName value );
/**
@Element SystemApplications of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = javax.management.ObjectName
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = system-applications
*/
public ObjectName getSystemApplications();
public void setSystemApplications( ObjectName value );
/**
@Element SystemProperty of interface
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.elementClass = [Ljavax.management.ObjectName;
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Element
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.system-property.com.sun.aas.configName =
server-config | java.lang.String | Name of the <config> used by a
server instance
amx.configbean.system-property.com.sun.aas.domainName =
domain1 | java.lang.String | Name of the domain. Not used in the
default configuration, but can be used to customize configuration
amx.configbean.system-property.com.sun.aas.hostName = |
java.lang.String | Operating system dependent. Path to the name of the
host (machine)
amx.configbean.system-property.com.sun.aas.imqLib = |
java.lang.String | Operating system dependent. Path to the
installation directory for the Java runtime
amx.configbean.system-property.com.sun.aas.installRoot = |
java.lang.String | Operating system dependent. Path to the directory
where the server is installed
amx.configbean.system-property.com.sun.aas.instanceName =
server1 | java.lang.String | Name of the server instance. Not used in
the default configuration, but can be used to customize configuration
amx.configbean.system-property.com.sun.aas.instanceRoot = |
java.lang.String | Operating system dependent. Path to the top level
directory for a server instance
amx.configbean.system-property.com.sun.aas.javaRoot = |
java.lang.String | Operating system dependent. Path to the library
directory for the Sun GlassFish Message Queue software
amx.configbean.toDo = IMPORTANT, Any more legal system
properties?
amx.configbean.variableExpansion = true
amx.configbean.xmlName = system-property
*/
public javax.management.ObjectName[] getSystemProperty();
public void setSystemProperty( javax.management.ObjectName[]
value );
/**
@Attribute Version
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:dataType =
class java.lang.String
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:defaultValue =
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:key
= false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:reference =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:required =
false
amx.configbean.annotation._at_org.jvnet.hk2.config.Attribute:value =
amx
.configbean
.annotation._at_org.jvnet.hk2.config.Attribute:variableExpansion = true
amx.configbean.dataType = java.lang.String
amx.configbean.key = false
amx.configbean.kind = org.jvnet.hk2.config.Attribute
amx.configbean.notNull = false
amx.configbean.reference = false
amx.configbean.required = false
amx.configbean.variableExpansion = true
amx.configbean.xmlName = version
*/
public String getVersion();
public void setVersion( String value );
// -------------------- Operations --------------------
/**
@param childType
@param params name/value pairs, even entries are names, odd
entries are values
@return ObjectName
*/
public ObjectName createChild( String childType, Object[] params );
/**
Create a child of the specified type
@param childType
@param params name/value pairs for attributes
@return ObjectName
*/
public ObjectName createChild( String childType, Map params );
/**
@DuckTyped getAllDefinedSystemApplications of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@return List
*/
public List getAllDefinedSystemApplications();
/**
@DuckTyped getApplicationRefInServer of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@param p1 parameter 1
@return ObjectName
*/
public ObjectName getApplicationRefInServer( String p0, String
p1 );
/**
Get the available default values
@param useAMXAttributeName true to use Attribute names, false
to use XML names
@return Map
*/
public Map getDefaultValues( boolean useAMXAttributeName );
/**
Get the default values for child type
@param type
@param useAMXAttributeName true to use Attribute names, false
to use XML names
@return Map
*/
public Map getDefaultValues( String type, boolean
useAMXAttributeName );
/**
@DuckTyped getParent of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@return ObjectName
*/
public ObjectName getParent();
/**
@DuckTyped getProperty of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@return ObjectName
*/
public ObjectName getProperty( String p0 );
/**
@DuckTyped getPropertyValue of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@return String
*/
public String getPropertyValue( String p0 );
/**
@DuckTyped getPropertyValue of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@param p1 parameter 1
@return String
*/
public String getPropertyValue( String p0, String p1 );
/**
@DuckTyped getPropertyValue of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@param p1 parameter 1
@return String
*/
public String getPropertyValue( String p0, String p1 );
/**
@DuckTyped getServerNamed of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@return ObjectName
*/
public ObjectName getServerNamed( String p0 );
/**
@DuckTyped getSystemApplicationReferencedFrom of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@param p1 parameter 1
@return ObjectName
*/
public ObjectName getSystemApplicationReferencedFrom( String p0,
String p1 );
/**
@DuckTyped getSystemApplicationsReferencedFrom of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@return List
*/
public List getSystemApplicationsReferencedFrom( String p0 );
/**
@DuckTyped getSystemProperty of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@return ObjectName
*/
public ObjectName getSystemProperty( String p0 );
/**
@DuckTyped getSystemPropertyValue of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@return String
*/
public String getSystemPropertyValue( String p0 );
/**
@DuckTyped isNamedSystemApplicationReferencedFrom of
com.sun.enterprise.config.serverbeans.Domain
amx.configbean.kind = org.jvnet.hk2.config.DuckTyped
@param p0 parameter 0
@param p1 parameter 1
@return boolean
*/
public boolean isNamedSystemApplicationReferencedFrom( String p0,
String p1 );
/**
@param childType
*/
public void removeChild( String childType );
/**
@param childType
@param name
*/
public void removeChild( String childType, String name );
/**
Get and resolve a (possible) ${...} attribute to a real value
@param attributeName
@return String
*/
public String resolveAttribute( String attributeName );
/**
Resolve a (possible) ${...} attribute *value* to a real value
@param value
@return String
*/
public String resolveAttributeValue( String value );
/**
Get and resolve attributes to values
@param attributeNames
@return AttributeList
*/
public AttributeList resolveAttributes( String[] attributeNames );
/**
Get and resolve a (possible) ${...} attribute to a Boolean,
returns null if not found
@param attributeName
@return Boolean
*/
public Boolean resolveBoolean( String attributeName );
/**
Get and resolve a (possible) ${...} attribute to a Long,
returns null if not found
@param attributeName
@return Long
*/
public Long resolveLong( String attributeName );
}
Matched 1 mbean(s).
jmxcmd>