JavaTM 2 Platform
Std. Ed. v1.3

java.beans.beancontext
インタフェース BeanContextServices

すべてのスーパーインタフェース:
BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, Collection, DesignMode, EventListener, Visibility
既知の実装クラスの一覧:
BeanContextServicesSupport

public interface BeanContextServices
extends BeanContext, BeanContextServicesListener

BeanContextServices インタフェースは、BeanContextChild オブジェクトが汎用サービスを受けられるようにするための機構を BeanContext に提供します。


インタフェース java.beans.beancontext.BeanContext から継承したフィールド
globalHierarchyLock
 
インタフェース java.beans.DesignMode から継承したフィールド
PROPERTYNAME
 
メソッドの概要
 void addBeanContextServicesListener(BeanContextServicesListener bcsl)
          この BeanContext に BeanContextServicesListener を追加します。
 boolean addService(Class serviceClass, BeanContextServiceProvider serviceProvider)
          この BeanContext にサービスを追加します。
 Iterator getCurrentServiceClasses()
          このコンテキストに現在使用可能なサービスを取得します。
 Iterator getCurrentServiceSelectors(Class serviceClass)
          基本的な BeanContextServiceProvider の getCurrentServiceSelectors() を呼び出すことによって、指定されたサービスのサービス依存サービスパラメータ (Service Selectors) のリストを取得します。
 Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl)
          BeanContextChild、または BeanContextChild に関連した任意のオブジェクトは、このメソッドを呼び出すことによって、入れ子になっている BeanContextServices から現在登録されているサービスへの参照を取得できます。
 boolean hasService(Class serviceClass)
          指定されたサービスが現在、このコンテキストから使用可能かどうかを報告します。
 void releaseService(BeanContextChild child, Object requestor, Object service)
          基本的な BeanContextServiceProvider の releaseService() を呼び出すことによって、BeanContextChild (または BeanContextChild に関連した任意のオブジェクト) の、指定されたサービスへの参照を解放します。
 void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
          この BeanContext から BeanContextServicesListener を削除します。
 void revokeService(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.util.Collection から継承したメソッド
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
インタフェース java.beans.DesignMode から継承したメソッド
isDesignTime, setDesignTime
 
インタフェース java.beans.Visibility から継承したメソッド
avoidingGui, dontUseGui, needsGui, okToUseGui
 
インタフェース java.beans.beancontext.BeanContextServicesListener から継承したメソッド
serviceAvailable
 
インタフェース java.beans.beancontext.BeanContextServiceRevokedListener から継承したメソッド
serviceRevoked
 

メソッドの詳細

addService

public boolean addService(Class serviceClass,
                          BeanContextServiceProvider serviceProvider)
この BeanContext にサービスを追加します。BeanContextServiceProvider がこのメソッドを呼び出して、このコンテキストに特定のサービスを登録します。そのサービスが以前に追加されていない場合、BeanContextServices はこのサービスを BeanContextServiceProvider と関連付け、現在登録されているすべての BeanContextServicesListenersBeanContextServiceAvailableEvent をトリガーします。続いてメソッドは true を返し、サービスの追加が完了したことを示します。指定されたサービスがすでに追加されている場合、このメソッドは単に false を返します。
パラメータ:
serviceClass - 追加するサービス
serviceProvider - サービスに関連した BeanContextServiceProvider

revokeService

public void revokeService(Class serviceClass,
                          BeanContextServiceProvider serviceProvider,
                          boolean revokeCurrentServicesNow)
現在登録されているサービスをこのコンテキストから削除するには、BeanContextServiceProviders は、このメソッドを呼び出します。サービスの呼び出しの際、BeanContextServices は、現在登録されている BeanContextServiceRevokedListeners および BeanContextServicesListeners のリストに、BeanContextServiceRevokedEvent をトリガーします。
パラメータ:
serviceClass - この BeanContextServices から呼び出すサービス
serviceProvider - 無効になるこの特定のサービスに関連した BeanContextServiceProvider
revokeCurrentServicesNow - 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 - この要求に関連した BeanContextChild
requestor - サービスを要求するオブジェクト
serviceClass - 要求されたサービスのクラス
serviceSelector - サービス依存パラメータ
bcsrl - サービスを後で無効にする必要がある場合に通知する BeanContextServiceRevokedListener
戻り値:
要求された、このコンテキストの指定された Service への参照、または null
例外:
TooManyListenersException -  

releaseService

public void releaseService(BeanContextChild child,
                           Object requestor,
                           Object service)
基本的な BeanContextServiceProvider の releaseService() を呼び出すことによって、BeanContextChild (または BeanContextChild に関連した任意のオブジェクト) の、指定されたサービスへの参照を解放します。
パラメータ:
child - BeanContextChild
requestor - 要求者
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

JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい 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.