- すべてのスーパー・インタフェース:
BeanContext,BeanContextChild,BeanContextServiceRevokedListener,BeanContextServicesListener,Collection,DesignMode,EventListener,Iterable,Visibility
- 既知のすべての実装クラス:
BeanContextServicesSupport
public interface BeanContextServices extends BeanContext, BeanContextServicesListener
BeanContextServicesインタフェースは、BeanContextChildオブジェクトがジェネリック・サービスを受けられるようにするためのメカニズムをBeanContextに提供します。
-
フィールドのサマリー
インタフェース java.beans.beancontext.BeanContextで宣言されたフィールド
globalHierarchyLockインタフェース java.beans.DesignModeで宣言されたフィールド
PROPERTYNAME -
メソッドのサマリー
修飾子と型メソッド説明voidこのBeanContextにBeanContextServicesListenerを追加しますbooleanaddService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider) このBeanContextにサービスを追加します。Iterator<?>このコンテキストに現在使用可能なサービスを取得します。Iterator<?>getCurrentServiceSelectors(Class<?> serviceClass) 基本的なBeanContextServiceProviderのgetCurrentServiceSelectors()を呼び出すことによって、指定されたサービスのサービス依存サービス・パラメータ(Service Selectors)のリストを取得します。getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) BeanContextChild、またはBeanContextChildに関連した任意のオブジェクトは、このメソッドを呼び出すことによって、入れ子になっているBeanContextServicesから現在登録されているサービスへの参照を取得できます。booleanhasService(Class<?> serviceClass) 指定されたサービスが現在、このコンテキストから使用可能かどうかを報告します。voidreleaseService(BeanContextChild child, Object requestor, Object service) ベースとなるBeanContextServiceProviderに対してreleaseService()を呼び出すことにより、BeanContextChild(またはBeanContextChildに関連した任意のオブジェクト)の、指定されたサービスへの参照を解放します。voidこのBeanContextからBeanContextServicesListenerを削除しますvoidrevokeService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow) 現在登録されているサービスをこのコンテキストから削除するために、BeanContextServiceProvidersは、このメソッドを呼び出して削除できます。インタフェース java.beans.beancontext.BeanContextで宣言されたメソッド
addBeanContextMembershipListener, getResource, getResourceAsStream, instantiateChild, removeBeanContextMembershipListenerインタフェース java.beans.beancontext.BeanContextChildで宣言されたメソッド
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContextインタフェース java.beans.beancontext.BeanContextServiceRevokedListenerで宣言されたメソッド
serviceRevokedインタフェース java.beans.beancontext.BeanContextServicesListenerで宣言されたメソッド
serviceAvailableインタフェース java.util.Collectionで宣言されたメソッド
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArrayインタフェース java.beans.DesignModeで宣言されたメソッド
isDesignTime, setDesignTimeインタフェース java.beans.Visibilityで宣言されたメソッド
avoidingGui, dontUseGui, needsGui, okToUseGui
-
メソッドの詳細
-
addService
boolean addService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider) このBeanContextにサービスを追加します。BeanContextServiceProviderは、このメソッドを呼び出して、このコンテキストに特定のサービスを登録します。 そのサービスが以前に追加されていない場合、BeanContextServicesはこのサービスをBeanContextServiceProviderと関連付け、現在登録されているすべてのBeanContextServicesListenersにBeanContextServiceAvailableEventをトリガーします。 続いてメソッドはtrueを返し、サービスの追加が完了したことを示します。 指定されたサービスがすでに追加されている場合、このメソッドは単にfalseを返します。- パラメータ:
serviceClass- 追加するサービスserviceProvider- そのサービスに関連付けられているBeanContextServiceProvider- 戻り値:
- サービスの追加が成功した場合はtrue、そうでない場合はfalse
-
revokeService
void revokeService(Class<?> serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow) 現在登録されているサービスをこのコンテキストから削除するために、BeanContextServiceProvidersは、このメソッドを呼び出して削除できます。 サービスの呼出しの際、BeanContextServicesは、現在登録されているBeanContextServiceRevokedListenersおよびBeanContextServicesListenersのリストに、BeanContextServiceRevokedEventをトリガーします。- パラメータ:
serviceClass- このBeanContextServicesから取り消すサービスserviceProvider- この取り消される特定のサービスに関連付けられているBeanContextServiceProviderrevokeCurrentServicesNow-trueという値は、BeanContextServiceProviderまたはBeanContextServicesが、指定されたサービスへの現在未処理の参照すべてに対してサービスをただちに終了しようとしている例外状況を示します。
-
hasService
boolean hasService(Class<?> serviceClass) 指定されたサービスが現在、このコンテキストから使用可能かどうかを報告します。- パラメータ:
serviceClass- 該当するサービス- 戻り値:
- サービスが使用可能な場合はtrue
-
getService
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- 戻り値:
- リクエストされた、このコンテキストの指定されたサービスへの参照、または
null - 例外:
TooManyListenersException- リスナーが多すぎる場合
-
releaseService
void releaseService(BeanContextChild child, Object requestor, Object service) ベースとなるBeanContextServiceProviderに対してreleaseService()を呼び出すことにより、BeanContextChild(またはBeanContextChildに関連した任意のオブジェクト)の、指定されたサービスへの参照を解放します。- パラメータ:
child-BeanContextChildrequestor- リクエスタservice- サービス
-
getCurrentServiceClasses
Iterator<?> getCurrentServiceClasses()このコンテキストに現在使用可能なサービスを取得します。- 戻り値:
- 現在使用可能なサービスで構成される
Iterator
-
getCurrentServiceSelectors
基本的なBeanContextServiceProviderのgetCurrentServiceSelectors()を呼び出すことによって、指定されたサービスのサービス依存サービス・パラメータ(Service Selectors)のリストを取得します。- パラメータ:
serviceClass- 指定されたサービス- 戻り値:
- 指定されたserviceClassで現在使用可能なサービス・セレクタ
-
addBeanContextServicesListener
void addBeanContextServicesListener(BeanContextServicesListener bcsl) このBeanContextにBeanContextServicesListenerを追加します- パラメータ:
bcsl- 追加するBeanContextServicesListener
-
removeBeanContextServicesListener
void removeBeanContextServicesListener(BeanContextServicesListener bcsl) このBeanContextからBeanContextServicesListenerを削除します- パラメータ:
bcsl- このコンテキストから削除するBeanContextServicesListener
-