< prev index next >

src/java.management/share/classes/java/lang/management/package.html

Print this page


   1 <!--
   2  Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
   3  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 
   5  This code is free software; you can redistribute it and/or modify it
   6  under the terms of the GNU General Public License version 2 only, as
   7  published by the Free Software Foundation.  Oracle designates this
   8  particular file as subject to the "Classpath" exception as provided
   9  by Oracle in the LICENSE file that accompanied this code.
  10 
  11  This code is distributed in the hope that it will be useful, but WITHOUT
  12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  version 2 for more details (a copy is included in the LICENSE file that
  15  accompanied this code).
  16 
  17  You should have received a copy of the GNU General Public License version
  18  2 along with this work; if not, write to the Free Software Foundation,
  19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 
  21  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  or visit www.oracle.com if you need additional information or have any


  52  getPlatformMBeanServer} method.  On the first call to this method,
  53 it creates the platform MBeanServer and registers all platform MXBeans
  54 including {@linkplain java.lang.management.PlatformManagedObject
  55 platform MXBeans}.
  56 Each platform MXBean is registered with a unique name defined in
  57 the specification of the management interface.
  58 This is a single MBeanServer that can be shared by different managed
  59 components running within the same Java virtual machine.
  60 
  61 <h3>Interoperability</h3>
  62 
  63 <p>A management application and a platform MBeanServer of a running
  64 virtual machine can interoperate
  65 without requiring classes used by the platform MXBean interfaces.
  66 The data types being transmitted between the JMX connector
  67 server and the connector client are JMX
  68 {@linkplain javax.management.openmbean.OpenType open types} and
  69 this allows interoperation across versions.
  70 A data type used by the MXBean interfaces are mapped to an
  71 open type when being accessed via MBeanServer interface.
  72 See the <a href="{@docRoot}/javax/management/MXBean.html#MXBean-spec">
  73 MXBean</a> specification for details.
  74 
  75 <h3><a id="examples">Ways to Access MXBeans</a></h3>
  76 
  77 <p>An application can monitor the instrumentation of the
  78 Java virtual machine and the runtime in the following ways:
  79 <p>
  80 <b>1. Direct access to an MXBean interface</b>
  81 <ul>
  82 <li>Get an MXBean instance locally in the running Java virtual machine:
  83 <pre>
  84    RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean();
  85 
  86    // Get the standard attribute "VmVendor"
  87    String vendor = mxbean.getVmVendor();
  88 </pre>
  89 <p>Or by calling the
  90         {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
  91                getPlatformMXBean} or
  92         {@link java.lang.management.ManagementFactory#getPlatformMXBeans(Class)


   1 <!--
   2  Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
   3  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 
   5  This code is free software; you can redistribute it and/or modify it
   6  under the terms of the GNU General Public License version 2 only, as
   7  published by the Free Software Foundation.  Oracle designates this
   8  particular file as subject to the "Classpath" exception as provided
   9  by Oracle in the LICENSE file that accompanied this code.
  10 
  11  This code is distributed in the hope that it will be useful, but WITHOUT
  12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  version 2 for more details (a copy is included in the LICENSE file that
  15  accompanied this code).
  16 
  17  You should have received a copy of the GNU General Public License version
  18  2 along with this work; if not, write to the Free Software Foundation,
  19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 
  21  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  or visit www.oracle.com if you need additional information or have any


  52  getPlatformMBeanServer} method.  On the first call to this method,
  53 it creates the platform MBeanServer and registers all platform MXBeans
  54 including {@linkplain java.lang.management.PlatformManagedObject
  55 platform MXBeans}.
  56 Each platform MXBean is registered with a unique name defined in
  57 the specification of the management interface.
  58 This is a single MBeanServer that can be shared by different managed
  59 components running within the same Java virtual machine.
  60 
  61 <h3>Interoperability</h3>
  62 
  63 <p>A management application and a platform MBeanServer of a running
  64 virtual machine can interoperate
  65 without requiring classes used by the platform MXBean interfaces.
  66 The data types being transmitted between the JMX connector
  67 server and the connector client are JMX
  68 {@linkplain javax.management.openmbean.OpenType open types} and
  69 this allows interoperation across versions.
  70 A data type used by the MXBean interfaces are mapped to an
  71 open type when being accessed via MBeanServer interface.
  72 See the <a href="{@docRoot}/java.management/javax/management/MXBean.html#MXBean-spec">
  73 MXBean</a> specification for details.
  74 
  75 <h3><a id="examples">Ways to Access MXBeans</a></h3>
  76 
  77 <p>An application can monitor the instrumentation of the
  78 Java virtual machine and the runtime in the following ways:
  79 <p>
  80 <b>1. Direct access to an MXBean interface</b>
  81 <ul>
  82 <li>Get an MXBean instance locally in the running Java virtual machine:
  83 <pre>
  84    RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean();
  85 
  86    // Get the standard attribute "VmVendor"
  87    String vendor = mxbean.getVmVendor();
  88 </pre>
  89 <p>Or by calling the
  90         {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
  91                getPlatformMXBean} or
  92         {@link java.lang.management.ManagementFactory#getPlatformMXBeans(Class)


< prev index next >