|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rioproject.jmx.JMXUtil
public class JMXUtil
Provides utilities for using JMX.
| Constructor Summary | |
|---|---|
JMXUtil()
|
|
| Method Summary | ||
|---|---|---|
static CompositeType |
createCompositeType(Map m,
String compositeTypeName,
String compositeTypeDescription)
Create a CompositeType |
|
static String |
getJMXConnection(Entry[] attributes)
Get the String value found in the JMXConnection entry, or null if the attribute set does not include a JMXConnection |
|
static Entry[] |
getJMXConnectionEntries(Configuration config)
Get the attributes to add to a service's attribute collection |
|
static String |
getJMXName(ServiceBeanContext context,
String defaultDomain)
Get the JMX name to use as a base name for the ObjectName. |
|
static ObjectName |
getObjectName(ServiceBeanContext context,
String defaultDomain,
String name)
Get an ObjectName with the following format : defaultDomain:type= |
|
static ObjectName |
getObjectName(ServiceBeanContext context,
String defaultDomain,
String name,
String id)
Get an ObjectName with the following format : defaultDomain:type= |
|
static OpenType |
getOpenType(String classString,
OpenType defaultType)
Get the corresponding OpenType for a fully qualified class name |
|
static
|
getPlatformMXBeanProxy(MBeanServerConnection mbsc,
String name,
Class<T> mxBeanInterface)
Get a platform MXBean proxy |
|
static boolean |
isOpenType(String className)
Determine if the class name is an OpenType |
|
static Map |
toMap(Object data)
Create a Map of accessor methods for the data object that are supported by OpenType.ALLOWED_CLASSNAMES |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JMXUtil()
| Method Detail |
|---|
public static <T> T getPlatformMXBeanProxy(MBeanServerConnection mbsc,
String name,
Class<T> mxBeanInterface)
mbsc - The MBeanServerConnectionname - The ObjectName to createmxBeanInterface - The platform MXBean interface type to create
public static Map toMap(Object data)
throws IntrospectionException,
IllegalAccessException,
InvocationTargetException
OpenType.ALLOWED_CLASSNAMES
data - The data to map
OpenType.ALLOWED_CLASSNAMES
IntrospectionException - If an exception occurred during the
introspection of an MBean
IllegalAccessException - If access permissions result reflecting
on the MBean
InvocationTargetException - If the MBean cannot be instantiated
public static CompositeType createCompositeType(Map m,
String compositeTypeName,
String compositeTypeDescription)
throws OpenDataException
CompositeType
m - A Map of accessor methods corresponding to open data typescompositeTypeName - The name to use for the composite type, must
not be null or an empty stringcompositeTypeDescription - The description to use for the
composite type, must not be null or an empty string
OpenDataException - If the CompositeType cannot be created
public static OpenType getOpenType(String classString,
OpenType defaultType)
classString - A fully qualified class name, suitable for use
with Class.forName(), must not be nulldefaultType - The defaultOpenType to use
NullPointerException - if the classString argument is null
InvalidOpenTypeException - if the class described by the
classString argument is not a valid open typepublic static boolean isOpenType(String className)
className - A fully qualified class name, suitable for use
with Class.forName(), must not be null
trueOpenType.ALLOWED_CLASSNAMES_LIST
public static String getJMXName(ServiceBeanContext context,
String defaultDomain)
ServiceBeanConfig.JMX_NAME property exists,
if it does not, the default domain will be used as a basis to create
the name, and the property will be added to the context with the
following format :
defaultDomain:type=
context - The ServiceBeanContext, must not be nulldefaultDomain - The default domain to use if the
ServiceBeanConfig.JMX_NAME property is not found
public static ObjectName getObjectName(ServiceBeanContext context,
String defaultDomain,
String name)
throws MalformedObjectNameException
context - The ServiceBeanContext, must not be nulldefaultDomain - The default domain to use if the
ServiceBeanConfig.JMX_NAME property is not foundname - The name to use
MalformedObjectNameException - If the constructed name is malformed
public static ObjectName getObjectName(ServiceBeanContext context,
String defaultDomain,
String name,
String id)
throws MalformedObjectNameException
context - The ServiceBeanContext, must not be nulldefaultDomain - The default domain to use if the
ServiceBeanConfig.JMX_NAME property is not foundname - The jmxName to useid - The instanceID of the bean
MalformedObjectNameException - If the constructed name is malformed
public static Entry[] getJMXConnectionEntries(Configuration config)
throws Exception
config - The configuration to use to optionally create an
RMI Registry and obtain an optionally configured host address
Entrys. If the
org.rioproject.jmxServiceURL system property exists (is not null)
create an array of 2 attributes, one being
JMXProtocolType with the protocol
type set to JMXProtocolType.RMI, the other
JMXProperty, set to the value of the property
org.rioproject.jmxServiceURL. If the
org.rioproject.jmxServiceURL property is not found, return a
zero-length array. A new array is created each time.
Exception - If the RMI registry or JMXConnection cannot be createdpublic static String getJMXConnection(Entry[] attributes)
attributes - An array of Entry attributes
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||