CompositeDataViewpublic class GarbageCollectionNotificationInfo extends Object implements CompositeDataView
 A garbage collection notification is emitted by GarbageCollectorMXBean when the Java virtual machine completes a garbage collection action The notification emitted will contain the garbage collection notification information about the status of the memory: 
GcInfo object containing some statistics about the GC cycle (start time, end time) and the memory usage before and after the GC cycle. A CompositeData representing the GarbageCollectionNotificationInfo object is stored in the userdata of a notification. The from method is provided to convert from a CompositeData to a GarbageCollectionNotificationInfo object. For example: 
      Notification notif;
      // receive the notification emitted by a GarbageCollectorMXBean and set to notif
      ...
      String notifType = notif.getType();
      if (notifType.equals(GarbageCollectionNotificationInfo.GARBAGE_COLLECTION_NOTIFICATION)) {
          // retrieve the garbage collection notification information
          CompositeData cd = (CompositeData) notif.getUserData();
          GarbageCollectionNotificationInfo info = GarbageCollectionNotificationInfo.from(cd);
          ....
      }
  The type of the notification emitted by a GarbageCollectorMXBean is: 
| Modifier and Type | Field | Description | 
|---|---|---|
| static final String | GARBAGE_COLLECTION_NOTIFICATION | Notification type denoting that the Java virtual machine has completed a garbage collection cycle. | 
| Constructor | Description | 
|---|---|
| GarbageCollectionNotificationInfo | Constructs a  GarbageCollectionNotificationInfoobject. | 
| Modifier and Type | Method | Description | 
|---|---|---|
| static GarbageCollectionNotificationInfo | from | Returns a  GarbageCollectionNotificationInfoobject represented by the givenCompositeData. | 
| String | getGcAction() | Returns the action performed by the garbage collector | 
| String | getGcCause() | Returns the cause of the garbage collection | 
| GcInfo | getGcInfo() | Returns the GC information related to the last garbage collection | 
| String | getGcName() | Returns the name of the garbage collector used to perform the collection | 
| CompositeData | toCompositeData | Return a  CompositeDatacorresponding to the values in this object. | 
public static final String GARBAGE_COLLECTION_NOTIFICATION
GarbageCollectorMXBean. The value of this notification type is com.sun.management.gc.notification.public GarbageCollectionNotificationInfo(String gcName, String gcAction, String gcCause, GcInfo gcInfo)
GarbageCollectionNotificationInfo object.gcName - The name of the garbage collector used to perform the collectiongcAction - The name of the action performed by the garbage collectorgcCause - The cause of the garbage collection actiongcInfo - a GcInfo object providing statistics about the GC cyclepublic String getGcName()
public String getGcAction()
public String getGcCause()
public GcInfo getGcInfo()
public static GarbageCollectionNotificationInfo from(CompositeData cd)
GarbageCollectionNotificationInfo object represented by the given CompositeData. The given CompositeData must contain the following attributes: 
Attribute Name Type gcName java.lang.StringgcAction java.lang.StringgcCause java.lang.StringgcInfo javax.management.openmbean.CompositeData
cd - CompositeData representing a GarbageCollectionNotificationInfo
GarbageCollectionNotificationInfo object represented by cd if cd is not null; null otherwise.IllegalArgumentException - if cd does not represent a GarbaageCollectionNotificationInfo object.public CompositeData toCompositeData(CompositeType ct)
CompositeDataViewReturn a CompositeData corresponding to the values in this object. The returned value should usually be an instance of CompositeDataSupport, or a class that serializes as a CompositeDataSupport via a writeReplace method. Otherwise, a remote client that receives the object might not be able to reconstruct it.
toCompositeData in interface CompositeDataView
ct - The expected CompositeType of the returned value. If the returned value is cd, then cd.getCompositeType().equals(ct) should be true. Typically this will be because cd is a CompositeDataSupport constructed with ct as its CompositeType.CompositeData.
    © 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
    https://docs.oracle.com/en/java/javase/21/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html