java.beans.beancontext
インタフェース BeanContextServices
- すべてのスーパーインタフェース:
- BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, Collection, DesignMode, EventListener, Visibility
- 既知の実装クラスの一覧:
- BeanContextServicesSupport
- public interface BeanContextServices
- extends BeanContext, BeanContextServicesListener
BeanContextServices インタフェースは、BeanContextChild オブジェクトが汎用サービスを受けられるようにするための機構を BeanContext に提供します。
| インタフェース java.util.Collection から継承したメソッド |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
addService
public boolean addService(Class serviceClass,
BeanContextServiceProvider serviceProvider)
- この BeanContext にサービスを追加します。
BeanContextServiceProvider がこのメソッドを呼び出して、このコンテキストに特定のサービスを登録します。そのサービスが以前に追加されていない場合、BeanContextServices はこのサービスを BeanContextServiceProvider と関連付け、現在登録されているすべての BeanContextServicesListeners に BeanContextServiceAvailableEvent をトリガーします。続いてメソッドは true を返し、サービスの追加が完了したことを示します。指定されたサービスがすでに追加されている場合、このメソッドは単に false を返します。
- パラメータ:
serviceClass - 追加するサービスserviceProvider - サービスに関連した BeanContextServiceProvider
revokeService
public void revokeService(Class serviceClass,
BeanContextServiceProvider serviceProvider,
boolean revokeCurrentServicesNow)
- 現在登録されているサービスをこのコンテキストから削除するには、BeanContextServiceProviders は、このメソッドを呼び出します。サービスの呼び出しの際、
BeanContextServices は、現在登録されている BeanContextServiceRevokedListeners および BeanContextServicesListeners のリストに、BeanContextServiceRevokedEvent をトリガーします。
- パラメータ:
serviceClass - この BeanContextServices から呼び出すサービスserviceProvider - 無効になるこの特定のサービスに関連した BeanContextServiceProviderrevokeCurrentServicesNow - true の値は、BeanContextServiceProvider または BeanContextServices が、指定されたサービスへの現在未処理の参照すべてに対してサービスを直ちに終了しようとしている例外状況を示す
hasService
public boolean hasService(Class serviceClass)
- 指定されたサービスが現在、このコンテキストから使用可能かどうかを報告します。
- パラメータ:
serviceClass - 該当するサービス- 戻り値:
- サービスが使用可能な場合は true
getService
public Object getService(BeanContextChild child,
Object requestor,
Class serviceClass,
Object serviceSelector,
BeanContextServiceRevokedListener bcsrl)
throws TooManyListenersException
BeanContextChild、または BeanContextChild に関連した任意のオブジェクトは、このメソッドを呼び出すことによって、入れ子になっている BeanContextServices から現在登録されているサービスへの参照を取得できます。呼び出されると、このメソッドは、基本的な BeanContextServiceProvider の getService() メソッドを呼び出すことによってサービスを取得します。
- パラメータ:
child - この要求に関連した BeanContextChildrequestor - サービスを要求するオブジェクトserviceClass - 要求されたサービスのクラスserviceSelector - サービス依存パラメータbcsrl - サービスを後で無効にする必要がある場合に通知する BeanContextServiceRevokedListener- 戻り値:
- 要求された、このコンテキストの指定された Service への参照、または
null - 例外:
TooManyListenersException -
releaseService
public void releaseService(BeanContextChild child,
Object requestor,
Object service)
- 基本的な
BeanContextServiceProvider の releaseService() を呼び出すことによって、BeanContextChild (または BeanContextChild に関連した任意のオブジェクト) の、指定されたサービスへの参照を解放します。
- パラメータ:
child - BeanContextChildrequestor - 要求者service - サービス
getCurrentServiceClasses
public Iterator getCurrentServiceClasses()
- このコンテキストに現在使用可能なサービスを取得します。
- 戻り値:
- 現在使用可能なサービスで構成される
Iterator
getCurrentServiceSelectors
public Iterator getCurrentServiceSelectors(Class serviceClass)
- 基本的な BeanContextServiceProvider の getCurrentServiceSelectors() を呼び出すことによって、指定されたサービスのサービス依存サービスパラメータ (Service Selectors) のリストを取得します。
- パラメータ:
serviceClass - 指定されたサービス- 戻り値:
- 指定された serviceClass で現在使用可能なサービスセレクタ
addBeanContextServicesListener
public void addBeanContextServicesListener(BeanContextServicesListener bcsl)
- この BeanContext に
BeanContextServicesListener を追加します。
- パラメータ:
bcsl - 追加する BeanContextServicesListener
removeBeanContextServicesListener
public void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
- この
BeanContext から BeanContextServicesListener を削除します。
- パラメータ:
bcsl - このコンテキストから削除する BeanContextServicesListener
バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。 Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.