- java.lang.Object
-  
      - com.sun.management.GarbageCollectionNotificationInfo
 
-  
       - 实现的所有接口
-  
         CompositeDataView
 
 public class GarbageCollectionNotificationInfo extends Object implements CompositeDataView 有关垃圾收集的信息当Java虚拟机完成垃圾收集操作时, GarbageCollectorMXBean将发出垃圾收集通知。发出的通知将包含有关内存状态的垃圾收集通知信息:- 用于执行集合的垃圾收集器的名称。
- 垃圾收集器执行的操作。
- 垃圾收集操作的原因。
-  GcInfo对象,包含有关GC周期(开始时间,结束时间)以及GC周期之前和之后的内存使用情况的一些统计信息。
 甲 CompositeData表示GarbageCollectionNotificationInfo对象被存储在userdata一个的notification 。 提供from方法以从CompositeData转换为GarbageCollectionNotificationInfo对象。 例如: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); .... }GarbageCollectorMXBean发出的通知类型为:-  A garbage collection notification 。 
 由垃圾收集器发出的每个通知使用,有关通知的详细信息在action字符串中提供
 
-  
        
       -  
             字段汇总字段 变量和类型 字段 描述 static StringGARBAGE_COLLECTION_NOTIFICATION表示Java虚拟机已完成垃圾回收周期的通知类型。
 -  
             构造方法摘要构造方法 构造器 描述 GarbageCollectionNotificationInfo(String gcName, String gcAction, String gcCause, GcInfo gcInfo)构造一个GarbageCollectionNotificationInfo对象。
 -  
             方法摘要所有方法 静态方法 实例方法 具体的方法 变量和类型 方法 描述 static GarbageCollectionNotificationInfofrom(CompositeData cd)返回由给定的CompositeData表示的GarbageCollectionNotificationInfo对象。StringgetGcAction()返回垃圾收集器执行的操作StringgetGcCause()返回垃圾回收的原因GcInfogetGcInfo()返回与上次垃圾回收相关的GC信息StringgetGcName()返回用于执行集合的垃圾收集器的名称-  
               声明方法的类 java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 -  
               声明方法的接口 javax.management.openmbean.CompositeDataViewtoCompositeData
 
-  
               
 
-  
             
-  
        
       -  
             方法详细信息-  getGcNamepublic String getGcName() 返回用于执行集合的垃圾收集器的名称- 结果
- 用于执行集合的垃圾收集器的名称
 
 -  getGcActionpublic String getGcAction() 返回垃圾收集器执行的操作- 结果
- 垃圾收集器执行的操作
 
 -  getGcCausepublic String getGcCause() 返回垃圾回收的原因- 结果
- 垃圾收集的原因
 
 -  getGcInfopublic GcInfo getGcInfo() 返回与上次垃圾回收相关的GC信息- 结果
- 与上次垃圾收集相关的GC信息
 
 -  frompublic static GarbageCollectionNotificationInfo from(CompositeData cd) 返回由给定的CompositeData表示的GarbageCollectionNotificationInfo对象。 给定的CompositeData必须包含以下属性:Attribute Name Type gcName java.lang.StringgcAction java.lang.StringgcCause java.lang.StringgcInfo javax.management.openmbean.CompositeData- 参数
-  
              cd-CompositeData代表GarbageCollectionNotificationInfo
- 结果
-  
              如果cd不是null,则由cd表示的GarbageCollectionNotificationInfo对象; 否则为null。
- 异常
-  
              IllegalArgumentException- 如果cd不表示GarbaageCollectionNotificationInfo对象。
 
 
-  
 
-