Skip to content

Commit

Permalink
remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
nizarbenalla committed May 24, 2024
1 parent 66bc3e9 commit 6271121
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Java virtual machine and other components in the Java runtime.
* It allows both local and remote
* monitoring and management of the running Java virtual machine.
*
*
* <h2><a id="MXBean">Platform MXBean</a></h2>
* <p>
* A platform MXBean is a <i>managed bean</i> that
Expand Down Expand Up @@ -158,10 +158,10 @@
* </pre>
* </li>
* </ul>
*
*
*
*
* <h2><a id="extension">Platform Extension</a></h2>
*
*
* <p>A Java virtual machine implementation may add its platform extension to
* the management interface by defining platform-dependent
* interfaces that extend the standard management interfaces to include
Expand Down Expand Up @@ -193,46 +193,46 @@
* for (com.sun.management.GarbageCollectorMXBean gc : mxbeans) {
* // Get the standard attribute "CollectionCount"
* String count = mxbean.getCollectionCount();
*
*
* // Get the platform-specific attribute "LastGcInfo"
* GcInfo gcinfo = gc.getLastGcInfo();
* ...
* }
* </pre>
* </blockquote>
*
*
* <p>
* 2) Access the Oracle-specific MXBean interface via <code>MBeanServer</code>
* through proxy
*
*
* <blockquote><pre>
* MBeanServerConnection mbs;
*
*
* // Connect to a running JVM (or itself) and get MBeanServerConnection
* // that has the JVM MXBeans registered in it
* ...
*
*
* List&lt;com.sun.management.GarbageCollectorMXBean&gt; mxbeans =
* ManagementFactory.getPlatformMXBeans(mbs, com.sun.management.GarbageCollectorMXBean.class);
*
*
* for (com.sun.management.GarbageCollectorMXBean gc : mxbeans) {
* // Get the standard attribute "CollectionCount"
* String count = mxbean.getCollectionCount();
*
*
* // Get the platform-specific attribute "LastGcInfo"
* GcInfo gcinfo = gc.getLastGcInfo();
* ...
* }
* </pre></blockquote>
*
*
* <p> Unless otherwise noted, passing a <code>null</code> argument to a constructor
* or method in any class or interface in this package will cause a {@link
* java.lang.NullPointerException NullPointerException} to be thrown.
*
*
* <p> The java.lang.management API is thread-safe.
*
*
* @see javax.management JMX Specification
*
*
* @author Mandy Chung
* @since 1.5
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
* reused many times with different management interfaces and
* managed resources, and it can provide common functionality
* such as persistence and caching.</p>
*
*
* <p>A Model MBean implements the {@link
* javax.management.modelmbean.ModelMBean ModelMBean} interface.
* It is a {@link javax.management.DynamicMBean DynamicMBean}
* whose {@link javax.management.DynamicMBean#getMBeanInfo()
* getMBeanInfo} method returns an object implementing {@link
* javax.management.modelmbean.ModelMBeanInfo
* ModelMBeanInfo}.</p>
*
*
* <p>Every MBean has an {@link javax.management.MBeanInfo
* MBeanInfo} with information about the MBean itself, and its
* attributes, operations, constructors, and notifications. A
Expand All @@ -51,34 +51,34 @@
* Usually, <code>Descriptor</code>s are instances of {@link
* javax.management.modelmbean.DescriptorSupport
* DescriptorSupport}.</p>
*
*
* <p>The class {@link
* javax.management.modelmbean.RequiredModelMBean
* RequiredModelMBean} provides a standard Model MBean
* implementation.</p>
*
*
* <p>The following example shows a Model MBean being used to make
* the <code>get</code> method of a <code>HashMap</code>
* available for management through an MBean server. No other
* methods are available through the MBean server. There is
* nothing special about <code>HashMap</code> here. Public
* methods from any public class can be exposed for management in
* the same way.</p>
*
*
* <pre>
* import java.lang.reflect.Method;
* import java.util.HashMap;
* import javax.management.*;
* import javax.management.modelmbean.*;
*
*
* // ...
*
*
* MBeanServer mbs = MBeanServerFactory.createMBeanServer();
* // The MBean Server
*
*
* HashMap map = new HashMap();
* // The resource that will be managed
*
*
* // Construct the management interface for the Model MBean
* Method getMethod = HashMap.class.getMethod("get", new Class[] {Object.class});
* ModelMBeanOperationInfo getInfo =
Expand All @@ -90,31 +90,31 @@
* null, // no constructors
* new ModelMBeanOperationInfo[] {getInfo},
* null); // no notifications
*
*
* // Make the Model MBean and link it to the resource
* ModelMBean mmb = new RequiredModelMBean(mmbi);
* mmb.setManagedResource(map, "ObjectReference");
*
*
* // Register the Model MBean in the MBean Server
* ObjectName mapName = new ObjectName(":type=Map,name=whatever");
* mbs.registerMBean(mmb, mapName);
*
*
* // Resource can evolve independently of the MBean
* map.put("key", "value");
*
*
* // Can access the "get" method through the MBean Server
* mbs.invoke(mapName, "get", new Object[] {"key"}, new String[] {Object.class.getName()});
* // returns "value"
* </pre>
*
*
* <h2><a id="spec">Package Specification</a></h2>
*
*
* <ul>
* <li>See the <i>JMX 1.4 Specification</i>
* <a href="https://jcp.org/aboutJava/communityprocess/mrel/jsr160/index2.html">
* JMX Specification, version 1.4</a>
* </ul>
*
*
* @since 1.5
*/
package javax.management.modelmbean;
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* to retrieve the value of the attribute being monitored it does
* so within the access control context of the
* {@link javax.management.monitor.Monitor#start} caller.</p>
*
*
* <p id="complex">The value being monitored can be a simple value
* contained within a complex type. For example, the {@link
* java.lang.management.MemoryMXBean MemoryMXBean} defined in
Expand All @@ -47,37 +47,37 @@
* argument to {@link
* javax.management.monitor.MonitorMBean#setObservedAttribute(String)
* setObservedAttribute}.</p>
*
*
* <p>The rules used to interpret an {@code ObservedAttribute} like
* {@code "HeapMemoryUsage.used"} are as follows. Suppose the string is
* <i>A.e</i> (so <i>A</i> would be {@code "HeapMemoryUsage"} and <i>e</i>
* would be {@code "used"} in the example).</p>
*
*
* <p>First the value of the attribute <i>A</i> is obtained. Call it
* <i>v</i>. A value <i>x</i> is extracted from <i>v</i> as follows:</p>
*
*
* <ul>
*
*
* <li>If <i>v</i> is a {@link javax.management.openmbean.CompositeData
* CompositeData} and if <i>v</i>.{@link
* javax.management.openmbean.CompositeData#get(String) get}(<i>e</i>)
* returns a value then <i>x</i> is that value.</li>
* <li>If <i>v</i> is an array and <i>e</i> is the string {@code "length"}
* then <i>x</i> is the length of the array.</li>
*
*
* <li>If the above rules do not produce a value, and if introspection, as
* if by calling <a href="{@docRoot}/java.desktop/java/beans/Introspector.html#getBeanInfo(java.lang.Class)">Introspector.getBeanInfo</a>
* , for the class of <i>v</i>
* (<i>v</i>.{@code getClass()}) identifies a property with the name
* (<i>v</i>.{@code getClass()}) identifies a property with the name
* <i>e</i>, then <i>x</i> is the result of reading the property value. </li>
*
*
* </ul>
*
*
* <p>The third rule means for example that if the attribute
* {@code HeapMemoryUsage} is a {@code MemoryUsage}, monitoring
* {@code "HeapMemoryUsage.used"} will obtain the observed value by
* calling {@code MemoryUsage.getUsed()}.</p>
*
*
* <p>If the {@code ObservedAttribute} contains more than one period,
* for example {@code "ConnectionPool.connectionStats.length"}, then the
* above rules are applied iteratively. Here, <i>v</i> would initially be
Expand All @@ -86,7 +86,7 @@
* {@code "connectionStats"}. Then <i>v</i> would be set to this <i>x</i>
* and a new <i>x</i> derived by applying the rules again with <i>e</i>
* equal to {@code "length"}.</p>
*
*
* <p>Although it is recommended that attribute names be valid Java
* identifiers, it is possible for an attribute to be called
* {@code HeapMemoryUsage.used}. This means that an
Expand All @@ -107,16 +107,16 @@
* implementation may therefore call {@code getMBeanInfo} on just one of
* the MBeans in this case. The behavior is also unspecified if the result
* of the check changes while the monitor is active.</p>
*
*
* <p>The exact behavior of monitors is detailed in the
* <a href="#spec">JMX Specification</a>. What follows is a
* summary.</p>
*
*
* <p>There are three kinds of Monitors:</p>
*
*
* <ul>
* <li>
*
*
* <p>A {@link javax.management.monitor.CounterMonitor
* CounterMonitor} observes attributes of integer
* type. The attributes are assumed to be non-negative, and
Expand All @@ -125,59 +125,59 @@
* observed attribute has an associated <em>threshold</em>
* value. A notification is sent when the attribute exceeds
* its threshold.</p>
*
*
* <p>An <em>offset</em> value can be specified. When an
* observed value exceeds its threshold, the threshold is
* incremented by the offset, or by a multiple of the offset
* sufficient to make the threshold greater than the new
* observed value.</p>
*
*
* <p>A <code>CounterMonitor</code> can operate in
* <em>difference mode</em>. In this mode, the value
* compared against the threshold is the difference between
* two successive observations of an attribute.</p>
*
*
* </li>
* <li>
*
*
* <p>A {@link javax.management.monitor.GaugeMonitor
* GaugeMonitor} observes attributes of numerical type. Each
* observed attribute has an associated <em>high
* threshold</em> and <em>low threshold</em>.</p>
*
*
* <p>When an observed attribute crosses the high threshold, if
* the <em>notify high</em> flag is true, then a notification
* is sent. Subsequent crossings of the high threshold value
* will not trigger further notifications until the gauge value
* becomes less than or equal to the low threshold.</p>
*
*
* <p>When an observed attribute crosses the low threshold, if
* the <em>notify low</em> flag is true, then a notification
* is sent. Subsequent crossings of the low threshold value
* will not trigger further notifications until the gauge
* value becomes greater than or equal to the high
* threshold.</p>
*
*
* <p>Typically, only one of the notify high and notify low
* flags is set. The other threshold is used to provide a
* <em>hysteresis</em> mechanism to avoid the repeated
* triggering of notifications when an attribute makes small
* oscillations around the threshold value.</p>
*
*
* <p>A <code>GaugeMonitor</code> can operate in <em>difference
* mode</em>. In this mode, the value compared against the
* high and low thresholds is the difference between two
* successive observations of an attribute.</p>
*
*
* </li>
* <li>
*
*
* <p>A {@link javax.management.monitor.StringMonitor
* StringMonitor} observes attributes of type
* <code>String</code>. A notification is sent when an
* observed attribute becomes equal and/or not equal to a
* given string.</p>
*
*
* </li>
* </ul>
* @see <a id="spec" href="https://jcp.org/aboutJava/communityprocess/mrel/jsr160/index2.html">
Expand Down
Loading

0 comments on commit 6271121

Please sign in to comment.