Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.
javax.management

Class JMX


  • public class JMX
    extends Object
    Static methods from the JMX API. There are no instances of this class.
    Since:
    1.6
    • Method Detail

      • newMBeanProxy

        public static <T> T newMBeanProxy(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.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", <etc>).

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

        This method is equivalent to newMBeanProxy(connection, objectName, interfaceClass, false).

        Type Parameters:
        T - allows the compiler to know that if the interfaceClass parameter is MyMBean.class, for example, then the return type is MyMBean.
        Parameters:
        connection - the MBean server to forward to.
        objectName - the name of the MBean within 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.
      • newMXBeanProxy

        public static <T> T newMXBeanProxy(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 MemoryUsage getMappedAttribute();
             public void setMappedAttribute(MemoryUsage memoryUsage);
             public MemoryUsage someOperation(String param1, MemoryUsage param2);
         }
         

        Then:

        • 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.

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

        This method is equivalent to newMXBeanProxy(connection, objectName, interfaceClass, false).

        Type Parameters:
        T - allows the compiler to know that if the interfaceClass parameter is MyMXBean.class, for example, then the return type is MyMXBean.
        Parameters:
        connection - the MBean server to forward to.
        objectName - the name of the MBean within connection to forward to.
        interfaceClass - the MXBean interface, which will also be implemented by the returned proxy.
        Returns:
        the new proxy instance.
      • 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 @MXBean or @MXBean(true) or if it does not have an @MXBean annotation and its name ends with "MXBean".

        Parameters:
        interfaceClass - The candidate interface.
        Returns:
        true if interfaceClass is an interface and meets the conditions described.
        Throws:
        NullPointerException - if interfaceClass is null.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-javax/management/JMX.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut