This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.management
class JMX

java.lang.Object extended by javax.management.JMX

public class JMX
extends Object

Static methods from the JMX API. There are no instances of this class.


Field Summary
static String DEFAULT_VALUE_FIELD
          The name of the field.
static String IMMUTABLE_INFO_FIELD
          The name of the field.
static String INTERFACE_CLASS_NAME_FIELD
          The name of the field.
static String LEGAL_VALUES_FIELD
          The name of the field.
static String MAX_VALUE_FIELD
          The name of the field.
static String MIN_VALUE_FIELD
          The name of the field.
static String MXBEAN_FIELD
          The name of the field.
static String OPEN_TYPE_FIELD
          The name of the field.
static String ORIGINAL_TYPE_FIELD
          The name of the field.
 
Method Summary
static boolean
isMXBeanInterface(Class interfaceClass)

          Test whether an interface is an MXBean interface.
static Object
newMBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class interfaceClass)

          Make a proxy for a Standard MBean in a local or remote MBean Server.
static Object
newMBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class interfaceClass, boolean notificationBroadcaster)

          Make a proxy for a Standard MBean in a local or remote MBean Server that may also support the methods of javax.management.NotificationEmitter.
static Object
newMXBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class interfaceClass)

          Make a proxy for an MXBean in a local or remote MBean Server.
static Object
newMXBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class interfaceClass, boolean notificationBroadcaster)

          Make a proxy for an MXBean in a local or remote MBean Server that may also support the methods of javax.management.NotificationEmitter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_VALUE_FIELD

public static final String DEFAULT_VALUE_FIELD
The name of the {@code defaultValue} field.

IMMUTABLE_INFO_FIELD

public static final String IMMUTABLE_INFO_FIELD
The name of the {@code immutableInfo} field.

INTERFACE_CLASS_NAME_FIELD

public static final String INTERFACE_CLASS_NAME_FIELD
The name of the {@code interfaceClassName} field.

LEGAL_VALUES_FIELD

public static final String LEGAL_VALUES_FIELD
The name of the {@code legalValues} field.

MAX_VALUE_FIELD

public static final String MAX_VALUE_FIELD
The name of the {@code maxValue} field.

MIN_VALUE_FIELD

public static final String MIN_VALUE_FIELD
The name of the {@code minValue} field.

MXBEAN_FIELD

public static final String MXBEAN_FIELD
The name of the {@code mxbean} field.

OPEN_TYPE_FIELD

public static final String OPEN_TYPE_FIELD
The name of the {@code openType} field.

ORIGINAL_TYPE_FIELD

public static final String ORIGINAL_TYPE_FIELD
The name of the {@code originalType} field.
Method Detail

isMXBeanInterface

public static boolean isMXBeanInterface(Class interfaceClass)

Test whether an interface is an MXBean interface. An interface is an MXBean interface if it is annotated {@link MXBean @MXBean} or {@code @MXBean(true)} or if it does not have an {@code @MXBean} annotation and its name ends with "{@code MXBean}".

Parameters:
interfaceClass - The candidate interface.
Returns:
true if {@code interfaceClass} is an interface and meets the conditions described.

newMBeanProxy

public static Object newMBeanProxy(MBeanServerConnection connection,
                                   ObjectName objectName,
                                   Class interfaceClass)

Make a proxy for a Standard MBean in a local or remote MBean Server.

If you have an MBean Server {@code mbs} containing an MBean with {@link ObjectName} {@code name}, and if the MBean's management interface is described by the Java interface {@code MyMBean}, you can construct a proxy for the MBean like this:

 MyMBean proxy = JMX.newMBeanProxy(mbs, name, MyMBean.class);
 

Suppose, for example, {@code MyMBean} looks like this:

 public interface MyMBean {
     public String getSomeAttribute();
     public void setSomeAttribute(String value);
     public void someOperation(String param1, int param2);
 }
 

Then you can execute:

The object returned by this method is a {@link Proxy} whose {@code InvocationHandler} is an {@link MBeanServerInvocationHandler}.

This method is equivalent to {@link #newMBeanProxy(MBeanServerConnection, ObjectName, Class, boolean) newMBeanProxy(connection, objectName, interfaceClass, false)}.

Parameters:
connection - the MBean server to forward to.
objectName - the name of the MBean within {@code connection} to forward to.
interfaceClass - the management interface that the MBean exports, which will also be implemented by the returned proxy.
Returns:
the new proxy instance.

newMBeanProxy

public static Object newMBeanProxy(MBeanServerConnection connection,
                                   ObjectName objectName,
                                   Class interfaceClass,
                                   boolean notificationBroadcaster)

Make a proxy for a Standard MBean in a local or remote MBean Server that may also support the methods of {@link NotificationEmitter}.

This method behaves the same as {@link #newMBeanProxy(MBeanServerConnection, ObjectName, Class)}, but additionally, if {@code notificationBroadcaster} is {@code true}, then the MBean is assumed to be a {@link NotificationBroadcaster} or {@link NotificationEmitter} and the returned proxy will implement {@link NotificationEmitter} as well as {@code interfaceClass}. A call to {@link NotificationBroadcaster#addNotificationListener} on the proxy will result in a call to {@link MBeanServerConnection#addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)}, and likewise for the other methods of {@link NotificationBroadcaster} and {@link NotificationEmitter}.

Parameters:
connection - the MBean server to forward to.
objectName - the name of the MBean within {@code connection} to forward to.
interfaceClass - the management interface that the MBean exports, which will also be implemented by the returned proxy.
notificationBroadcaster - make the returned proxy implement {@link NotificationEmitter} by forwarding its methods via {@code connection}.
Returns:
the new proxy instance.

newMXBeanProxy

public static Object newMXBeanProxy(MBeanServerConnection connection,
                                    ObjectName objectName,
                                    Class interfaceClass)

Make a proxy for an MXBean in a local or remote MBean Server.

If you have an MBean Server {@code mbs} containing an MXBean with {@link ObjectName} {@code name}, and if the MXBean's management interface is described by the Java interface {@code MyMXBean}, you can construct a proxy for the MXBean like this:

 MyMXBean proxy = JMX.newMXBeanProxy(mbs, name, MyMXBean.class);
 

Suppose, for example, {@code MyMXBean} looks like this:

 public interface MyMXBean {
     public String getSimpleAttribute();
     public void setSimpleAttribute(String value);
     public {@link java.lang.management.MemoryUsage} getMappedAttribute();
     public void setMappedAttribute(MemoryUsage memoryUsage);
     public MemoryUsage someOperation(String param1, MemoryUsage param2);
 }
 

Then:

The object returned by this method is a {@link Proxy} whose {@code InvocationHandler} is an {@link MBeanServerInvocationHandler}.

This method is equivalent to {@link #newMXBeanProxy(MBeanServerConnection, ObjectName, Class, boolean) newMXBeanProxy(connection, objectName, interfaceClass, false)}.

Parameters:
connection - the MBean server to forward to.
objectName - the name of the MBean within {@code connection} to forward to.
interfaceClass - the MXBean interface, which will also be implemented by the returned proxy.
Returns:
the new proxy instance.

newMXBeanProxy

public static Object newMXBeanProxy(MBeanServerConnection connection,
                                    ObjectName objectName,
                                    Class interfaceClass,
                                    boolean notificationBroadcaster)

Make a proxy for an MXBean in a local or remote MBean Server that may also support the methods of {@link NotificationEmitter}.

This method behaves the same as {@link #newMXBeanProxy(MBeanServerConnection, ObjectName, Class)}, but additionally, if {@code notificationBroadcaster} is {@code true}, then the MXBean is assumed to be a {@link NotificationBroadcaster} or {@link NotificationEmitter} and the returned proxy will implement {@link NotificationEmitter} as well as {@code interfaceClass}. A call to {@link NotificationBroadcaster#addNotificationListener} on the proxy will result in a call to {@link MBeanServerConnection#addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object)}, and likewise for the other methods of {@link NotificationBroadcaster} and {@link NotificationEmitter}.

Parameters:
connection - the MBean server to forward to.
objectName - the name of the MBean within {@code connection} to forward to.
interfaceClass - the MXBean interface, which will also be implemented by the returned proxy.
notificationBroadcaster - make the returned proxy implement {@link NotificationEmitter} by forwarding its methods via {@code connection}.
Returns:
the new proxy instance.


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.