Java jmx management javax

Java jmx management javax

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

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

Methods declared in class java.lang.Object

Field Detail

DEFAULT_VALUE_FIELD

IMMUTABLE_INFO_FIELD

INTERFACE_CLASS_NAME_FIELD

public static final String INTERFACE_CLASS_NAME_FIELD

MAX_VALUE_FIELD

MIN_VALUE_FIELD

MXBEAN_FIELD

OPEN_TYPE_FIELD

ORIGINAL_TYPE_FIELD

Method Detail

newMBeanProxy

public static T 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 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);
  • proxy.getSomeAttribute() which will result in a call to mbs. getAttribute (name, «SomeAttribute») .
  • proxy.setSomeAttribute(«whatever») which will result in a call to mbs. setAttribute (name, new Attribute(«SomeAttribute», «whatever»)) .
  • proxy.someOperation(«param1», 2) which will be translated into a call to mbs. invoke (name, «someOperation», ) .

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

newMBeanProxy

public static T newMBeanProxy​(MBeanServerConnection connection, ObjectName objectName, Class interfaceClass, boolean notificationEmitter)

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 newMBeanProxy(MBeanServerConnection, ObjectName, Class) , but additionally, if notificationEmitter 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(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) on the proxy will result in a call to MBeanServerConnection.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object) , and likewise for the other methods of NotificationBroadcaster and NotificationEmitter .

newMXBeanProxy

public static T 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 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);
public interface MyMXBean < public String getSimpleAttribute(); public void setSimpleAttribute(String value); public MemoryUsage getMappedAttribute(); public void setMappedAttribute(MemoryUsage memoryUsage); public MemoryUsage someOperation(String param1, MemoryUsage param2); >
  • proxy.getSimpleAttribute() will result in a call to mbs. getAttribute (name, «SimpleAttribute») .
  • proxy.setSimpleAttribute(«whatever») will result in a call to mbs. setAttribute (name, new Attribute(«SimpleAttribute», «whatever»)) . Because String is a simple type, in the sense of SimpleType , it is not changed in the context of an MXBean. The MXBean proxy behaves the same as a Standard MBean proxy (see 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 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.
Читайте также:  Код для html бордовый

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

newMXBeanProxy

public static T newMXBeanProxy​(MBeanServerConnection connection, ObjectName objectName, Class interfaceClass, boolean notificationEmitter)

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 newMXBeanProxy(MBeanServerConnection, ObjectName, Class) , but additionally, if notificationEmitter 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(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) on the proxy will result in a call to MBeanServerConnection.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object) , and likewise for the other methods of NotificationBroadcaster and NotificationEmitter .

isMXBeanInterface

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

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Class JMX

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

Читайте также:  Переход на следующую строку питон

newMXBeanProxy (MBeanServerConnection connection, ObjectName objectName, Class interfaceClass, boolean notificationEmitter)

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

Methods declared in class java.lang.Object

Field Details

DEFAULT_VALUE_FIELD

IMMUTABLE_INFO_FIELD

INTERFACE_CLASS_NAME_FIELD

MAX_VALUE_FIELD

MIN_VALUE_FIELD

MXBEAN_FIELD

OPEN_TYPE_FIELD

ORIGINAL_TYPE_FIELD

Method Details

newMBeanProxy

public static T 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 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);
  • proxy.getSomeAttribute() which will result in a call to mbs. getAttribute (name, «SomeAttribute») .
  • proxy.setSomeAttribute(«whatever») which will result in a call to mbs. setAttribute (name, new Attribute(«SomeAttribute», «whatever»)) .
  • proxy.someOperation(«param1», 2) which will be translated into a call to mbs. invoke (name, «someOperation», ) .

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

newMBeanProxy

public static T newMBeanProxy (MBeanServerConnection connection, ObjectName objectName, Class interfaceClass, boolean notificationEmitter)

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 newMBeanProxy(MBeanServerConnection, ObjectName, Class) , but additionally, if notificationEmitter 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(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) on the proxy will result in a call to MBeanServerConnection.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object) , and likewise for the other methods of NotificationBroadcaster and NotificationEmitter .

newMXBeanProxy

public static T 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 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);
public interface MyMXBean < public String getSimpleAttribute(); public void setSimpleAttribute(String value); public MemoryUsage getMappedAttribute(); public void setMappedAttribute(MemoryUsage memoryUsage); public MemoryUsage someOperation(String param1, MemoryUsage param2); >
  • proxy.getSimpleAttribute() will result in a call to mbs. getAttribute (name, «SimpleAttribute») .
  • proxy.setSimpleAttribute(«whatever») will result in a call to mbs. setAttribute (name, new Attribute(«SimpleAttribute», «whatever»)) . Because String is a simple type, in the sense of SimpleType , it is not changed in the context of an MXBean. The MXBean proxy behaves the same as a Standard MBean proxy (see 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 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.
Читайте также:  Листинг всех файлов php

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

newMXBeanProxy

public static T newMXBeanProxy (MBeanServerConnection connection, ObjectName objectName, Class interfaceClass, boolean notificationEmitter)

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 newMXBeanProxy(MBeanServerConnection, ObjectName, Class) , but additionally, if notificationEmitter 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(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) on the proxy will result in a call to MBeanServerConnection.addNotificationListener(ObjectName, NotificationListener, NotificationFilter, Object) , and likewise for the other methods of NotificationBroadcaster and NotificationEmitter .

isMXBeanInterface

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

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Оцените статью