- java.lang.Object
- 
- com.sun.management.GarbageCollectionNotificationInfo
 
- 
- すべての実装されたインタフェース:
- CompositeDataView
 
 public class GarbageCollectionNotificationInfo extends Object implements CompositeDataView ガベージ・コレクションに関する情報Java仮想マシンがガベージ・コレクション・アクションを完了すると、 GarbageCollectorMXBeanによってガベージ・コレクション通知が発行されます。発行される通知には、メモリーのステータスに関するガベージ・コレクション通知情報が含まれます:- コレクションを実行するために使用されたガベージ・コレクタの名前。
- ガベージ・コレクタで実行されるアクション。
- ガベージ・コレクション・アクションの原因。
- GCサイクル(開始時間、終了時間)とGCサイクル前後のメモリー使用状況に関する統計情報を含むGcInfoオブジェクト。
 GarbageCollectionNotificationInfoオブジェクトを表すCompositeDataは、notificationのuserdataに格納されます。CompositeDataからGarbageCollectionNotificationInfoオブジェクトに変換するために、fromメソッドが提供されます。 次に例を示します。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によって発行される通知の型は、次のとおりです。- ガベージ・コレクション通知。 
 ガベージ・コレクタによって発行されるすべての通知に使用されます。通知の詳細はaction Stringで提供されます
 
- 
- 
フィールドのサマリーフィールド 修飾子と型 フィールド 説明 static StringGARBAGE_COLLECTION_NOTIFICATIONJava仮想マシンがガベージ・コレクションのサイクルを完了したことを示す通知型。
 - 
コンストラクタのサマリーコンストラクタ コンストラクタ 説明 GarbageCollectionNotificationInfo(String gcName, String gcAction, String gcCause, GcInfo gcInfo)GarbageCollectionNotificationInfoオブジェクトを構築します。
 - 
メソッドのサマリー修飾子と型 メソッド 説明 static GarbageCollectionNotificationInfofrom(CompositeData cd)指定されたCompositeDataにより表されたGarbageCollectionNotificationInfoオブジェクトを返します。StringgetGcAction()ガベージ・コレクタによって実行されたアクションを返します。StringgetGcCause()ガベージ・コレクションの原因を返します。GcInfogetGcInfo()最後のガベージ・コレクションに関連するGC情報を返します。StringgetGcName()コレクションを実行するために使用されるガベージ・コレクタの名前を返します- 
クラス java.lang.Objectで宣言されたメソッドclone、equals、finalize、getClass、hashCode、notify、notifyAll、toString、wait、wait、wait
 - 
インタフェース javax.management.openmbean.CompositeDataViewで宣言されたメソッドtoCompositeData
 
- 
 
- 
- 
- 
フィールドの詳細- 
GARBAGE_COLLECTION_NOTIFICATIONpublic static final String GARBAGE_COLLECTION_NOTIFICATION Java仮想マシンがガベージ・コレクションのサイクルを完了したことを示す通知型。 この通知は、GarbageCollectorMXBeanによって発行されます。 この通知型の値はcom.sun.management.gc.notificationです。- 関連項目:
- 定数フィールド値
 
 
- 
 - 
コンストラクタの詳細- 
GarbageCollectionNotificationInfopublic GarbageCollectionNotificationInfo(String gcName, String gcAction, String gcCause, GcInfo gcInfo) GarbageCollectionNotificationInfoオブジェクトを構築します。- パラメータ:
- gcName- コレクションを実行するために使用されるガベージ・コレクタの名前
- gcAction- ガベージ・コレクタで実行されるアクションの名前
- gcCause- ガベージ・コレクション・アクションの原因
- gcInfo- GCサイクルに関する統計情報を提供するGcInfoオブジェクト
 
 
- 
 - 
メソッドの詳細- 
getGcNamepublic String getGcName() コレクションを実行するために使用されるガベージ・コレクタの名前を返します- 戻り値:
- コレクションを実行するために使用されるガベージ・コレクタの名前
 
 - 
getGcActionpublic String getGcAction() ガベージ・コレクタによって実行されたアクションを返します。- 戻り値:
- ガベージ・コレクタによって実行されるアクション
 
 - 
getGcCausepublic String getGcCause() ガベージ・コレクションの原因を返します。- 戻り値:
- ガベージ・コレクションの原因
 
 - 
getGcInfopublic GcInfo getGcInfo() 最後のガベージ・コレクションに関連するGC情報を返します。- 戻り値:
- 最後のガベージ・コレクションに関連するGC情報
 
 - 
frompublic static GarbageCollectionNotificationInfo from(CompositeData cd) 指定されたCompositeDataにより表されたGarbageCollectionNotificationInfoオブジェクトを返します。 指定されたCompositeDataは、次の属性を含む必要があります。属性名 型 gcName java.lang.StringgcAction java.lang.StringgcCause java.lang.StringgcInfo javax.management.openmbean.CompositeData- パラメータ:
- cd-- GarbageCollectionNotificationInfoを表す- CompositeData
- 戻り値:
- cdが- nullでない場合は- cdにより表される- GarbageCollectionNotificationInfoオブジェクト、そうでない場合は- null。
- 例外:
- IllegalArgumentException-- cdが- GarbaageCollectionNotificationInfoオブジェクトを表さない場合。
 
 
- 
 
-