|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjavax.management.NotificationFilterSupport
public class NotificationFilterSupport
NotificationFilter インタフェースの実装を提供します。通知型属性には、フィルタリングが適用されます。
有効な通知型のリストを管理します。ユーザーは、メソッドを利用して、必要な数の通知型を有効または無効にできます。
通知ブロードキャスタは、フィルタに登録されたリスナーに通知を送信する前に、この通知型とフィルタによって有効化されるすべての通知型を比較します。フィルタがこの通知型を有効にする場合に限り、通知はリスナーに送信されます。
例:
NotificationFilterSupport myFilter = new NotificationFilterSupport();
myFilter.enableType("my_example.my_type");
myBroadcaster.addListener(myListener, myFilter, null);
リスナー myListener は、「my_example.my_type」と等しいか、この文字列で始まる型の通知だけを受信します。
NotificationBroadcaster.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object),
直列化された形式| コンストラクタの概要 | |
|---|---|
NotificationFilterSupport()
|
|
| メソッドの概要 | |
|---|---|
void |
disableAllTypes()
すべての通知型を無効にします。 |
void |
disableType(String prefix)
接頭辞リストから指定された接頭辞を削除します。 |
void |
enableType(String prefix)
特定の接頭辞で始まるすべての通知型の通知をリスナーに送信します。 |
Vector<String> |
getEnabledTypes()
このフィルタ用に、すべての有効な通知型を取得します。 |
boolean |
isNotificationEnabled(Notification notification)
リスナーへの特定の通知の送信前に呼び出されます。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public NotificationFilterSupport()
| メソッドの詳細 |
|---|
public boolean isNotificationEnabled(Notification notification)
true を返します。
NotificationFilter 内の isNotificationEnablednotification - 送信される通知
true、そうでない場合は false
public void enableType(String prefix)
throws IllegalArgumentException
例:
// Enables all notifications the type of which starts with "my_example" to be sent.
myFilter.enableType("my_example");
// Enables all notifications the type of which is "my_example.my_type" to be sent.
myFilter.enableType("my_example.my_type");
次の点に注意してください。
myFilter.enableType("my_example.*");
は、どの通知型とも一致しません。
prefix - 接頭辞
IllegalArgumentException - 接頭辞パラメータが null の場合public void disableType(String prefix)
prefix - 接頭辞public void disableAllTypes()
public Vector<String> getEnabledTypes()
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。