Package wt.jmx.core
Class MBeanRegistry
java.lang.Object
wt.jmx.core.MBeanRegistry
Provides constants and utilities related to registration of MBeans with an
MBeanServer.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ObjectNameObjectName of MBeanServerDelegate
Supported API: truestatic final Stringstatic final StringObjectName property value (seeObjectNamefor SUB_SYSTEM_PROP_KEY for Windchill monitors
Supported API: truestatic final Stringstatic final Stringstatic final StringObjectName property key (seeObjectNamefor top-level (non-servlet) Windchill system name
Supported API: truestatic final StringObjectName property key (seeObjectNamefor logical Windchill type name.static final String -
Method Summary
Modifier and TypeMethodDescriptionstatic MBeanServerGet the MBeanServer instance to be targeted.static StringgetPostfixedObjectNameString(ObjectName objectName, String[][] postfixNameValuePairs) Create an ObjectName within the branch of the JMX "tree" noted by origObjectNameString.static StringgetPrefixedObjectNameString(String domain, String[][] prefixNameValuePairs, ObjectName objectName) Namespace an object name by a specified prefix.static StringgetPropString(String[][] nameValuePairs) Produce an ObjectName property string from specified key/value pairs
Supported API: truestatic booleanisObjectNameInstanceOf(ObjectName objectName, String classname) Determines whether the MBean with the given object name is an instance of the given class.static booleanisObjectNameRegistered(ObjectName objectName) Determines whether the given object name is registered with the target MBeanServer.static StringquoteIfNecessary(String string) Apply ObjectName.quote() to string only where necessary; otherwise the original string is returned.static ObjectNameregisterMBean(Object mbean, String name) Registers 'mbean' under ObjectName specified as a String.static ObjectNameregisterMBean(Object mbean, String domain, String[][] nameValuePairs) Registers 'mbean' under an ObjectName formed from 'domain' and property key/value pairs specified by 'nameValuePairs' and returns the ObjectName under which the MBean is registred unless registration fails, in which case null is returned.static ObjectNameregisterMBean(Object mbean, ObjectName objectName) Registers 'mbean' under specified ObjectName.static voidunregisterMBean(ObjectName objectName) Unregister the MBean registered under the specified ObjectName if an MBean is registered under the given name, otherwise does nothing.
-
Field Details
-
DOMAIN_NAME
- See Also:
-
SERVLET_ENGINE_SYSTEM_PROP_KEY
- See Also:
-
SERVLET_ENGINE_SUBSYSTEM_PROP_KEY
- See Also:
-
MONITOR_TYPE_PROP_KEY
- See Also:
-
WEB_APP_CONTEXT_PROP_KEY
- See Also:
-
SUB_SYSTEM_PROP_KEY
ObjectName property key (seeObjectNamefor top-level (non-servlet) Windchill system name
Supported API: true- See Also:
-
TYPE_PROP_KEY
ObjectName property key (seeObjectNamefor logical Windchill type name. Use this in place of "type" in Windchill MBean naming as some JMX consoles (Java 6's jconsole, for instance) place special meaning and undesirable behavior on usages of "type" (and "j2eeType") as property keys.
Supported API: true- See Also:
-
MONITORS_SUB_SYSTEM_PROP
ObjectName property value (seeObjectNamefor SUB_SYSTEM_PROP_KEY for Windchill monitors
Supported API: true- See Also:
-
MBEAN_SERVER_DELEGATE_OBJECTNAME
ObjectName of MBeanServerDelegate
Supported API: true
-
-
Method Details
-
getMBeanServer
Get the MBeanServer instance to be targeted. This method should generally be used to obtain the MBeanServer unless the platform MBeanServer (see getPlatformMBeanServer() inManagementFactory) is specifically required.
Supported API: true -
isObjectNameRegistered
Determines whether the given object name is registered with the target MBeanServer.
Supported API: true -
isObjectNameInstanceOf
Determines whether the MBean with the given object name is an instance of the given class.
Supported API: true -
registerMBean
Registers 'mbean' under an ObjectName formed from 'domain' and property key/value pairs specified by 'nameValuePairs' and returns the ObjectName under which the MBean is registred unless registration fails, in which case null is returned.
Supported API: true -
registerMBean
Registers 'mbean' under specified ObjectName. Returns the ObjectName under which the MBean is registered unless registration fails, in which case null is returned.
Supported API: true -
registerMBean
Registers 'mbean' under ObjectName specified as a String. Returns the ObjectName under which the MBean is registered unless registration fails, in which case null is returned.
Supported API: true -
unregisterMBean
Unregister the MBean registered under the specified ObjectName if an MBean is registered under the given name, otherwise does nothing.
Supported API: true -
getPostfixedObjectNameString
public static String getPostfixedObjectNameString(ObjectName objectName, String[][] postfixNameValuePairs) Create an ObjectName within the branch of the JMX "tree" noted by origObjectNameString. Names in 'postfixNameValuePairs' are adjusted as necessary to ensure unique property names within the resulting ObjectName string.
Supported API: true- Parameters:
objectName- prefix to use in resulting ObjectName stringpostfixNameValuePairs- ObjectName property key/value pairs to append to 'objectname' to obtain resulting ObjectName string
-
quoteIfNecessary
Apply ObjectName.quote() to string only where necessary; otherwise the original string is returned.
Supported API: true- Parameters:
string- string to quote as needed for inclusion in an ObjectName
-
getPrefixedObjectNameString
public static String getPrefixedObjectNameString(String domain, String[][] prefixNameValuePairs, ObjectName objectName) Namespace an object name by a specified prefix. The domain and property keys in 'objectName' are adjusted as necessary to ensure unique property keys in the resulting ObjectName string (e.g. the domain is treated as a "domain" property for starters).Given that jconsole keys off the ObjectName's order (even though it is not significant for search we take care never to use the Hashtable accessors but always the strings, which is much more painful, but gives the desired hierarchy in jconsole.
Supported API: true- Parameters:
domain- ObjectName domain to use in resulting ObjectNameprefixNameValuePairs- property key/value pairs to use as start of resulting ObjectNameobjectName- ObjectName to namespace by other parameters, i.e. to use as tail of resulting ObjectName
-
getPropString
Produce an ObjectName property string from specified key/value pairs
Supported API: true
-