Java Doc for JMX.java in  » 6.0-JDK-Core » management » javax » management » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » management » javax.management 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.management.JMX

JMX
public class JMX (Code)
Static methods from the JMX API. There are no instances of this class.
since:
   1.6


Field Summary
final public static  StringDEFAULT_VALUE_FIELD
     The name of the defaultValue field.
final public static  StringIMMUTABLE_INFO_FIELD
     The name of the immutableInfo field.
final public static  StringINTERFACE_CLASS_NAME_FIELD
     The name of the interfaceClassName field.
final public static  StringLEGAL_VALUES_FIELD
     The name of the legalValues field.
final public static  StringMAX_VALUE_FIELD
     The name of the maxValue field.
final public static  StringMIN_VALUE_FIELD
     The name of the minValue field.
final public static  StringMXBEAN_FIELD
     The name of the mxbean field.
final public static  StringOPEN_TYPE_FIELD
     The name of the openType field.
final public static  StringORIGINAL_TYPE_FIELD
     The name of the originalType field.
final static  JMXproof
    


Method Summary
public static  booleanisMXBeanInterface(Class interfaceClass)
    

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


Parameters:
  interfaceClass - The candidate interface.
public static  TnewMBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class<T> interfaceClass)
    

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

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

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

Suppose, for example, 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:

  • proxy.getSomeAttribute() which will result in a call to mbs.
public static  TnewMBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class<T> interfaceClass, boolean notificationBroadcaster)
    

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

This method behaves the same as JMX.newMBeanProxy(MBeanServerConnection,ObjectName,Class) , but additionally, if notificationBroadcaster is true , then the MBean is assumed to be a NotificationBroadcaster or NotificationEmitter and the returned proxy will implement NotificationEmitter as well as interfaceClass .

public static  TnewMXBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class<T> interfaceClass)
    

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

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

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

Suppose, for example, MyMXBean looks like this:

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

Then:

  • proxy.getSimpleAttribute() will result in a call to mbs.

public static  TnewMXBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class<T> interfaceClass, boolean notificationBroadcaster)
    

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

This method behaves the same as JMX.newMXBeanProxy(MBeanServerConnection,ObjectName,Class) , but additionally, if notificationBroadcaster is true , then the MXBean is assumed to be a NotificationBroadcaster or NotificationEmitter and the returned proxy will implement NotificationEmitter as well as interfaceClass .


Field Detail
DEFAULT_VALUE_FIELD
final public static String DEFAULT_VALUE_FIELD(Code)
The name of the defaultValue field.



IMMUTABLE_INFO_FIELD
final public static String IMMUTABLE_INFO_FIELD(Code)
The name of the immutableInfo field.



INTERFACE_CLASS_NAME_FIELD
final public static String INTERFACE_CLASS_NAME_FIELD(Code)
The name of the interfaceClassName field.



LEGAL_VALUES_FIELD
final public static String LEGAL_VALUES_FIELD(Code)
The name of the legalValues field.



MAX_VALUE_FIELD
final public static String MAX_VALUE_FIELD(Code)
The name of the maxValue field.



MIN_VALUE_FIELD
final public static String MIN_VALUE_FIELD(Code)
The name of the minValue field.



MXBEAN_FIELD
final public static String MXBEAN_FIELD(Code)
The name of the mxbean field.



OPEN_TYPE_FIELD
final public static String OPEN_TYPE_FIELD(Code)
The name of the openType field.



ORIGINAL_TYPE_FIELD
final public static String ORIGINAL_TYPE_FIELD(Code)
The name of the originalType field.



proof
final static JMX proof(Code)





Method Detail
isMXBeanInterface
public static boolean isMXBeanInterface(Class interfaceClass)(Code)

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


Parameters:
  interfaceClass - The candidate interface. true if interfaceClass is an interface andmeets the conditions described.
throws:
  NullPointerException - if interfaceClass is null.



newMBeanProxy
public static T newMBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class<T> interfaceClass)(Code)

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

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

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

Suppose, for example, 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 Proxy whose InvocationHandler is an MBeanServerInvocationHandler .

This method is equivalent to JMX.newMBeanProxy(MBeanServerConnection,ObjectName,Class,boolean) newMBeanProxy(connection, objectName, interfaceClass,false) .


Parameters:
  connection - the MBean server to forward to.
Parameters:
  objectName - the name of the MBean within connection to forward to.
Parameters:
  interfaceClass - the management interface that the MBeanexports, which will also be implemented by the returned proxy.<
Parameters:
  T - > allows the compiler to know that if the interfaceClass parameter is MyMBean.class , forexample, then the return type is MyMBean . the new proxy instance.



newMBeanProxy
public static T newMBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class<T> interfaceClass, boolean notificationBroadcaster)(Code)

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

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


Parameters:
  connection - the MBean server to forward to.
Parameters:
  objectName - the name of the MBean within connection to forward to.
Parameters:
  interfaceClass - the management interface that the MBeanexports, which will also be implemented by the returned proxy.
Parameters:
  notificationBroadcaster - make the returned proxyimplement NotificationEmitter by forwarding its methodsvia connection .<
Parameters:
  T - > allows the compiler to know that if the interfaceClass parameter is MyMBean.class , forexample, then the return type is MyMBean . the new proxy instance.



newMXBeanProxy
public static T newMXBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class<T> interfaceClass)(Code)

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

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

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

Suppose, for example, MyMXBean looks like this:

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

Then:

  • proxy.getSimpleAttribute() will result in a call to mbs. MBeanServerConnection.getAttributegetAttribute (name, "SimpleAttribute") .

  • proxy.setSimpleAttribute("whatever") will result in a call to mbs. MBeanServerConnection.setAttribute setAttribute (name, new Attribute("SimpleAttribute", "whatever")).

    Because String is a simple type, in the sense of javax.management.openmbean.SimpleType , it is not changed in the context of an MXBean. The MXBean proxy behaves the same as a Standard MBean proxy (see JMX.newMBeanProxy(MBeanServerConnection,ObjectName,Class) newMBeanProxy ) for the attribute SimpleAttribute .

  • proxy.getMappedAttribute() will result in a call to mbs.getAttribute("MappedAttribute") . The MXBean mapping rules mean that the actual type of the attribute MappedAttribute will be javax.management.openmbean.CompositeData CompositeData and that is what the mbs.getAttribute call will return. The proxy will then convert the CompositeData back into the expected type MemoryUsage using the MXBean mapping rules.

  • Similarly, proxy.setMappedAttribute(memoryUsage) will convert the MemoryUsage argument into a CompositeData before calling mbs.setAttribute .

  • proxy.someOperation("whatever", memoryUsage) will convert the MemoryUsage argument into a CompositeData and call mbs.invoke . The value returned by mbs.invoke will be also be a CompositeData , and the proxy will convert this into the expected type MemoryUsage using the MXBean mapping rules.

The object returned by this method is a Proxy whose InvocationHandler is an MBeanServerInvocationHandler .

This method is equivalent to JMX.newMXBeanProxy(MBeanServerConnection,ObjectName,Class,boolean) newMXBeanProxy(connection, objectName, interfaceClass,false) .


Parameters:
  connection - the MBean server to forward to.
Parameters:
  objectName - the name of the MBean within connection to forward to.
Parameters:
  interfaceClass - the MXBean interface,which will also be implemented by the returned proxy.<
Parameters:
  T - > allows the compiler to know that if the interfaceClass parameter is MyMXBean.class , forexample, then the return type is MyMXBean . the new proxy instance.



newMXBeanProxy
public static T newMXBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class<T> interfaceClass, boolean notificationBroadcaster)(Code)

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

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


Parameters:
  connection - the MBean server to forward to.
Parameters:
  objectName - the name of the MBean within connection to forward to.
Parameters:
  interfaceClass - the MXBean interface,which will also be implemented by the returned proxy.
Parameters:
  notificationBroadcaster - make the returned proxyimplement NotificationEmitter by forwarding its methodsvia connection .<
Parameters:
  T - > allows the compiler to know that if the interfaceClass parameter is MyMXBean.class , forexample, then the return type is MyMXBean . the new proxy instance.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.