クラスGarbageCollectionNotificationInfo
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で提供されます
- 導入されたバージョン:
- 1.7
-
フィールドのサマリー
フィールド -
コンストラクタのサマリー
コンストラクタコンストラクタ説明GarbageCollectionNotificationInfo(String gcName, String gcAction, String gcCause, GcInfo gcInfo) GarbageCollectionNotificationInfoオブジェクトを構築します。 -
メソッドのサマリー
修飾子と型メソッド説明from(CompositeData cd) 指定されたCompositeDataにより表されたGarbageCollectionNotificationInfoオブジェクトを返します。ガベージ・コレクタによって実行されたアクションを返します。ガベージ・コレクションの原因を返します。最後のガベージ・コレクションに関連するGC情報を返します。コレクションを実行するために使用されるガベージ・コレクタの名前を返しますこのオブジェクト内の値に対応するCompositeDataを返します。
-
フィールド詳細
-
GARBAGE_COLLECTION_NOTIFICATION
public static final String GARBAGE_COLLECTION_NOTIFICATIONJava仮想マシンがガベージ・コレクションのサイクルを完了したことを示す通知型。 この通知は、GarbageCollectorMXBeanによって発行されます。 この通知型の値はcom.sun.management.gc.notificationです。- 関連項目:
-
-
コンストラクタの詳細
-
GarbageCollectionNotificationInfo
public GarbageCollectionNotificationInfo(String gcName, String gcAction, String gcCause, GcInfo gcInfo) GarbageCollectionNotificationInfoオブジェクトを構築します。- パラメータ:
gcName- コレクションを実行するために使用されるガベージ・コレクタの名前gcAction- ガベージ・コレクタで実行されるアクションの名前gcCause- ガベージ・コレクション・アクションの原因gcInfo- GCサイクルに関する統計情報を提供するGcInfoオブジェクト
-
-
メソッドの詳細
-
getGcName
-
getGcAction
-
getGcCause
-
getGcInfo
-
from
public 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オブジェクトを表さない場合。
-
toCompositeData
public CompositeData toCompositeData(CompositeType ct) インタフェース:CompositeDataViewからコピーされた説明このオブジェクト内の値に対応する
CompositeDataを返します。 通常、戻り値はCompositeDataSupportのインスタンス、またはwriteReplaceメソッドを介してCompositeDataSupportとして直列化を行うクラスになります。 それ以外の場合、オブジェクトを受信するリモート・クライアントは、再構築を実行できない可能性があります。- 定義:
toCompositeData、インタフェースCompositeDataView- パラメータ:
ct- 戻り値の予想されるCompositeType。 戻り値がcdである場合、cd.getCompositeType().equals(ct)はtrueになる。 通常、これは、cdがctをCompositeTypeとして構築されたCompositeDataSupportであるため。- 戻り値:
CompositeData。
-