public class GarbageCollectionNotificationInfo extends Object implements CompositeDataView
Java 仮想マシンがガベージコレクションアクションを完了すると、GarbageCollectorMXBean
によってガベージコレクション通知が発行されます。発行される通知には、メモリーのステータスに関するガベージコレクション通知情報が含まれています。
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
によって発行される通知の型は、次のとおりです。
修飾子と型 | フィールドと説明 |
---|---|
static String |
GARBAGE_COLLECTION_NOTIFICATION
Java 仮想マシンがガベージコレクションのサイクルを完了したことを示す通知型。
|
コンストラクタと説明 |
---|
GarbageCollectionNotificationInfo(String gcName, String gcAction, String gcCause, GcInfo gcInfo)
GarbageCollectionNotificationInfo オブジェクトを構築します。 |
修飾子と型 | メソッドと説明 |
---|---|
static GarbageCollectionNotificationInfo |
from(CompositeData cd)
指定された
CompositeData により表された GarbageCollectionNotificationInfo オブジェクトを返します。 |
String |
getGcAction()
ガベージコレクタで実行されるアクションを返します
|
String |
getGcCause()
ガベージコレクションの原因を返します
|
GcInfo |
getGcInfo()
最後のガベージコレクションに関連する GC 情報を返します。
|
String |
getGcName()
コレクションを実行するために使用されるガベージコレクタの名前を返します
|
CompositeData |
toCompositeData(CompositeType ct)
このオブジェクト内の値に対応する
CompositeData を返します。 |
public static final String GARBAGE_COLLECTION_NOTIFICATION
GarbageCollectorMXBean
によって発行されます。この通知型の値は com.sun.management.gc.notification
です。public GarbageCollectionNotificationInfo(String gcName, String gcAction, String gcCause, GcInfo gcInfo)
GarbageCollectionNotificationInfo
オブジェクトを構築します。gcName
- コレクションを実行するために使用されるガベージコレクタの名前gcAction
- ガベージコレクタで実行されるアクションの名前gcCause
- ガベージコレクションアクションの原因gcInfo
- GC サイクルに関する統計情報を提供する GcInfo オブジェクトpublic String getGcName()
public String getGcAction()
public String getGcCause()
public GcInfo getGcInfo()
public static GarbageCollectionNotificationInfo from(CompositeData cd)
CompositeData
により表された GarbageCollectionNotificationInfo
オブジェクトを返します。指定された CompositeData
は、次の属性を含む必要があります。
属性名 型 gcName java.lang.String
gcAction java.lang.String
gcCause java.lang.String
gcInfo javax.management.openmbean.CompositeData
cd
- GarbageCollectionNotificationInfo
を表す CompositeData
cd
が null
でない場合は cd
により表される GarbageCollectionNotificationInfo
オブジェクト、そうでない場合は null
。IllegalArgumentException
- cd
が GarbaageCollectionNotificationInfo
オブジェクトを表さない場合。public CompositeData toCompositeData(CompositeType ct)
javax.management.openmbean.CompositeDataView
このオブジェクト内の値に対応する CompositeData
を返します。通常、戻り値は CompositeDataSupport
のインスタンス、または writeReplace
メソッドを介して CompositeDataSupport
として直列化を行うクラスになります。それ以外の場合、オブジェクトを受信するリモートクライアントは、再構築を実行できない可能性があります。
toCompositeData
、インタフェース: CompositeDataView
ct
- 戻り値の予想される CompositeType
。戻り値が cd
である場合、cd.getCompositeType().equals(ct)
は true になる。通常、これは、cd
が ct
を CompositeType
として構築された CompositeDataSupport
であるため。CompositeData
。
Copyright © 2003, 2013, Oracle and/or its affiliates. All rights reserved.