Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.jmx
Class JMXUtil

    java.lang.Object
      org.jini.rio.jmx.JMXUtil

    public class JMXUtil

extends Object

Provides utilities for using JMX.

Constructor Summary
`JMXUtil()`

Method Summary
`static CompositeData` | `createCompositeData(Object data, String name, String description)` Create CompositeData
`static CompositeType` | `createCompositeType(Map m, String compositeTypeName, String compositeTypeDescription)` Create a `CompositeType`
`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=,name=servicename, name=, id=`
`static ObjectName` | `getObjectName(ServiceBeanContext context, String defaultDomain, String name, String id)` Get an ObjectName with the following format : `defaultDomain:type=,name=servicename, name=, id=`
`static OpenType` | `getOpenType(String classString, OpenType defaultType)` Get the corresponding OpenType for a fully qualified class name
`static boolean` | `isOpenType(String classname)` Determine if the classname 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

### JMXUtil

    public JMXUtil()

Method Detail

### createCompositeData

    public static CompositeData createCompositeData(Object data,
                                                    String name,
                                                    String description)
                                             throws IntrospectionException,
                                                    InvocationTargetException,
                                                    IllegalAccessException,
                                                    OpenDataException

  Create CompositeData

  Parameters:
    `data` - The data to use
    `name` - The name given to the composite type this instance represents; cannot be a null or empty string.
    `description` - The human readable description of the composite type this instance represents; cannot be a null or empty string.
  Returns:
    the CompositeData for the provided data Object
  Throws:
    `IntrospectionException` - If an exception occurred during the introspection of an MBean
    `IllegalAccessException` - If access permisions result reflecting on the MBean
    `InvocationTargetException` - If the MBean cannot be instantiated
    `OpenDataException` - If the CompositeType cannot be created

### toMap

    public static Map toMap(Object data)
                     throws IntrospectionException,
                            IllegalAccessException,
                            InvocationTargetException

  Create a Map of accessor methods for the data object that are supported by `OpenType.ALLOWED_CLASSNAMES`

  Parameters:
    `data` - The data to map
  Returns:
    A Map of accessor methods for the data object that are supported by `OpenType.ALLOWED_CLASSNAMES`
  Throws:
    `IntrospectionException` - If an exception occurred during the introspection of an MBean
    `IllegalAccessException` - If access permisions result reflecting on the MBean
    `InvocationTargetException` - If the MBean cannot be instantiated

### createCompositeType

    public static CompositeType createCompositeType(Map m,
                                                    String compositeTypeName,
                                                    String compositeTypeDescription)
                                             throws OpenDataException

  Create a `CompositeType`

  Parameters:
    `m` - A Map of accessor methods corresponding to open data types
    `compositeTypeName` - The name to use for the composite type, must not be null or an empty string
    `compositeTypeDescription` - The description to use for the composite type, must not be null or an empty string
  Returns:
    The created CompositeType
  Throws:
    `OpenDataException` - If the CompositeType cannot be created

### getOpenType

    public static OpenType getOpenType(String classString,
                                       OpenType defaultType)

  Get the corresponding OpenType for a fully qualified class name

  Parameters:
    `classString` - A fully qualified class name, suitable for use with Class.forName(), must not be null
    `defaultType` - The defaultOpenType to use
  Returns:
    the corresponding OpenType
  Throws:
    `NullPointerException` - if the classString argument is null
    `InvalidOpenTypeException` - if the class described by the classString argument is not a valid open type

### isOpenType

    public static boolean isOpenType(String classname)

  Determine if the classname is an OpenType

  Parameters:
    `classname` - A fully qualified class name, sutable for use with Class.forName(), must not be null
  Returns:
    If the clsssname is supported as an OpenType return `true`
  See Also:
    `OpenType.ALLOWED_CLASSNAMES`

### getJMXName

    public static String getJMXName(ServiceBeanContext context,
                                    String defaultDomain)

  Get the JMX name to use as a base name for the ObjectName. Key property list values should be appended to the value to create ObjectName instances. This method will check to see if the `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=,name=servicename`

  Parameters:
    `context` - The ServiceBeanContext, must not be null
    `defaultDomain` - The default domain to use if the ServiceBeanConfig.JMX_NAME property is not found
  Returns:
    A String to use as a base name for the ObjectName. The returned value will have the name with the format of: `jmxName,location=hostaddress,uuid=uuid-string`

### getObjectName

    public static ObjectName getObjectName(ServiceBeanContext context,
                                           String defaultDomain,
                                           String name)
                                    throws MalformedObjectNameException

  Get an ObjectName with the following format : `defaultDomain:type=,name=servicename, name=, id=`

  Parameters:
    `context` - The ServiceBeanContext, must not be null
    `defaultDomain` - The default domain to use if the ServiceBeanConfig.JMX_NAME property is not found
    `name` - The name to use
  Returns:
    The created ObjectName
  Throws:
    `MalformedObjectNameException` - If the constructed name is malformed

### getObjectName

    public static ObjectName getObjectName(ServiceBeanContext context,
                                           String defaultDomain,
                                           String name,
                                           String id)
                                    throws MalformedObjectNameException

  Get an ObjectName with the following format :

  `defaultDomain:type=,name=servicename, name=, id=`

  Parameters:
    `context` - The ServiceBeanContext, must not be null
    `defaultDomain` - The default domain to use if the ServiceBeanConfig.JMX_NAME property is not found
    `name` - The jmxName to use
    `id` - The instanceID of the bean
  Returns:
    An ObjectName based on the ServceBeanContext, defaultDomain, name and id
  Throws:
    `MalformedObjectNameException` - If the constructed name is malformed

### getJMXConnectionEntries

    public static Entry[] getJMXConnectionEntries(Configuration config)
                                           throws Exception

  Get the attributes to add to a service's attribute collection

  Parameters:
    `config` - The configuration to use to optionally create an RMI Registry and obtain an optionally configured host address
  Returns:
    An array of `Entry`s. If the `org.jini.rio.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` with the property `org.jini.rio.jmxServiceURL` set to it's value. If the `org.jini.rio.jmxServiceURL` property is not found, return a zero-length array. A new array is created each time.
  Throws:
    `Exception` - If the RMI registry or JMXConnection cannot be created

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.