java.lang.Object
java.beans.beancontext.BeanContextChildSupport
java.beans.beancontext.BeanContextSupport
java.beans.beancontext.BeanContextServicesSupport
- すべての実装されたインタフェース:
- BeanContext,- BeanContextChild,- BeanContextServiceRevokedListener,- BeanContextServices,- BeanContextServicesListener,- DesignMode,- PropertyChangeListener,- VetoableChangeListener,- Visibility,- Serializable,- Iterable,- Collection,- EventListener
public class BeanContextServicesSupport extends BeanContextSupport implements BeanContextServices
このヘルパー・クラスは、java.beans.beancontext.BeanContextServicesインタフェースのユーティリティの実装を提供します。
このクラスは、BeanContextServicesインタフェースを直接実装するため、この実装をサブクラス化することによって、あるいはBeanContextProxyインタフェースを介してほかのインスタンスからこのクラスのインスタンスを委譲することによって使用することを目的としています。
- 導入されたバージョン:
- 1.2
- 関連項目:
- 直列化された形式
- 
ネストされたクラスのサマリーネストされたクラス修飾子と型クラス説明protected classprotected classprotected static classサブクラスは、この入れ子構造のクラスをサブクラス化して、各BeanContextServicesProviderの動作を追加できます。クラス java.beans.beancontext.BeanContextSupportで宣言されたネストされたクラス/インタフェースBeanContextSupport.BCSChild, BeanContextSupport.BCSIterator
- 
フィールドのサマリーフィールド修飾子と型フィールド説明protected ArrayList<BeanContextServicesListener>BeanContextServicesListenerオブジェクトのリスト。BeanContextServiceProviderの委譲。protected int直列化可能なBeanContextServceProviderのインスタンスの数。protected transient HashMap servicesフィールドへのすべてのアクセスは、そのオブジェクトで同期する必要がありますクラス java.beans.beancontext.BeanContextSupportで宣言されたフィールドbcmListeners, children, designTime, locale, okToUseGuiクラス java.beans.beancontext.BeanContextChildSupportで宣言されたフィールドbeanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupportインタフェース java.beans.beancontext.BeanContextで宣言されたフィールドglobalHierarchyLockインタフェース java.beans.DesignModeで宣言されたフィールドPROPERTYNAME
- 
コンストラクタのサマリーコンストラクタコンストラクタ説明ほかのオブジェクトの委譲でないインスタンスを生成します。ピアを使ってインスタンスを生成します。BeanContextServicesSupport(BeanContextServices peer, Locale lcle)指定されたロケールを使ってインスタンスを生成します。BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dtime)指定されたロケールを使って設計モードでインスタンスを生成します。BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dTime, boolean visible)BeanContextServicesSupportのインスタンスを生成します。
- 
メソッドのサマリー修飾子と型メソッド説明voidBeanContextServicesListenerを追加します。booleanaddService(Class<?> serviceClass, BeanContextServiceProvider bcsp)サービスを追加します。protected booleanaddService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)サービスを追加します。protected voidBeanContextSupport readObjectが子を直列化する前に、BeanContextSupport readObjectによって呼び出されます。protected voidBeanContextSupport writeObjectが子を直列化する前に、BeanContextSupport writeObjectによって呼び出されます。protected voidchildJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)子が正常に削除された後で、スーパー・クラスの子削除操作から呼び出されます。子が同期された状態で呼び出されます。protected BeanContextSupport.BCSChildcreateBCSChild(Object targetChild, Object peer)サブクラスはこのメソッドをオーバーライドすることにより、セットに子を追加するadd()メソッドやほかのCollectionメソッドをオーバーライドすることなく、Childの独自のサブクラスを挿入することができます。createBCSSServiceProvider(Class<?> sc, BeanContextServiceProvider bcsp)サブクラスはこのメソッドをオーバーライドすることにより、インスタンス化するためにaddService()をオーバーライドすることなく、BCSSServiceProviderの新しいサブクラスを作成できます。protected void新しいサービスが利用可能になったことを示すBeanContextServiceAvailableEventをトリガーします。protected voidfireServiceAdded(Class<?> serviceClass)新しいサービスを通知するBeanContextServiceEventをトリガーします。protected voidサービスの取消しを通知するBeanContextServiceEventをトリガーします。protected voidfireServiceRevoked(Class<?> serviceClass, boolean revokeNow)特定のサービスが利用できなくなったことを示すBeanContextServiceRevokedEventをトリガーします。このBeanContextServicesSupportに関連付けられているBeanContextServicesを取得します。protected static BeanContextServicesListener指定された子のBeanContextServicesListener(存在する場合)を取得します。このコンテキストに現在使用可能なサービスを取得します。Iterator<?>getCurrentServiceSelectors(Class<?> serviceClass)基本的なBeanContextServiceProviderのgetCurrentServiceSelectors()を呼び出すことによって、指定されたサービスのサービス依存サービス・パラメータ(Service Selectors)のリストを取得します。getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl)サービスを取得します。そのサービスは委譲されることもあります。booleanhasService(Class<?> serviceClass)サービスを持ちます。そのサービスは委譲されることもあります。voidサブクラスの一時的な状態を初期化するために、作成時および直列化復元時にBeanContextSupportのスーパー・クラスによって呼び出されます。protected void入れ子になっているBeanContextから取得したリソースを割り当てるようBeanContextChildに通知するために、setBeanContextから呼び出されます。protected void入れ子になっているBeanContextから取得したリソースを解放するようBeanContextChildに通知するために、setBeanContextから呼び出されます。voidreleaseService(BeanContextChild child, Object requestor, Object service)サービスを解放します。voidBeanContextServicesListenerを削除します。voidrevokeService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow)サービスを削除します。voidBeanContextServicesListenerのコールバックです。このBeanContextServiceがまだこのサービスを実装していない場合は、現在登録されているすべてのリスナーおよびBeanContextServicesの子にイベントを送ります。voidBeanContextServicesListenerのコールバックです。このBeanContextServiceがまだこのサービスを実装していない場合は、現在登録されているすべてのリスナーおよびBeanContextServicesの子にイベントを送ります。クラス java.beans.beancontext.BeanContextSupportで宣言されたメソッドadd, addAll, addBeanContextMembershipListener, avoidingGui, bcsChildren, childDeserializedHook, childJustAddedHook, classEquals, clear, contains, containsAll, containsKey, copyChildren, deserialize, dontUseGui, fireChildrenAdded, fireChildrenRemoved, getBeanContextPeer, getChildBeanContextChild, getChildBeanContextMembershipListener, getChildPropertyChangeListener, getChildSerializable, getChildVetoableChangeListener, getChildVisibility, getLocale, getResource, getResourceAsStream, instantiateChild, isDesignTime, isEmpty, isSerializing, iterator, needsGui, okToUseGui, propertyChange, readChildren, remove, remove, removeAll, removeBeanContextMembershipListener, retainAll, serialize, setDesignTime, setLocale, size, toArray, toArray, validatePendingAdd, validatePendingRemove, vetoableChange, writeChildrenクラス java.beans.beancontext.BeanContextChildSupportで宣言されたメソッドaddPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, isDelegated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, validatePendingSetBeanContextクラス java.lang.Objectで宣言されたメソッドclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitインタフェース 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, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArrayインタフェース java.beans.DesignModeで宣言されたメソッドisDesignTime, setDesignTimeインタフェース java.beans.Visibilityで宣言されたメソッドavoidingGui, dontUseGui, needsGui, okToUseGui
- 
フィールド詳細- 
サービスprotected transient HashMap<Object,BeanContextServicesSupport.BCSSServiceProvider> servicesprotected transient HashMap servicesフィールドへのすべてのアクセスは、そのオブジェクトで同期する必要があります
- 
serializableprotected transient int serializable直列化可能なBeanContextServceProviderのインスタンスの数。
- 
proxyprotected transient BeanContextServicesSupport.BCSSProxyServiceProvider proxyBeanContextServiceProviderの委譲。
- 
bcsListenersprotected transient ArrayList<BeanContextServicesListener> bcsListenersBeanContextServicesListenerオブジェクトのリスト。
 
- 
- 
コンストラクタの詳細- 
BeanContextServicesSupportpublic BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dTime, boolean visible)BeanContextServicesSupportのインスタンスを生成します。 - パラメータ:
- peer- 実装の提供先となるピアBeanContext、このオブジェクトが自身のピアである場合はnull
- lcle- このBeanContextの現在のロケール。
- dTime- 初期状態、設計モードの場合はtrue、実行時の場合はfalse。
- visible- 初期状態での可視性。
 
- 
BeanContextServicesSupportpublic BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dtime)指定されたロケールを使って設計モードでインスタンスを生成します。- パラメータ:
- peer- 実装の提供先となるピアBeanContext、このオブジェクトが自身のピアである場合はnull
- lcle- このBeanContextの現在のロケール。
- dtime- 初期状態、設計モードの場合はtrue、実行時の場合はfalse。
 
- 
BeanContextServicesSupportpublic BeanContextServicesSupport(BeanContextServices peer, Locale lcle)指定されたロケールを使ってインスタンスを生成します。- パラメータ:
- peer- 実装の提供先となるピアBeanContext、このオブジェクトが自身のピアである場合はnull
- lcle- このBeanContextの現在のロケール。
 
- 
BeanContextServicesSupportpublic BeanContextServicesSupport(BeanContextServices peer)ピアを使ってインスタンスを生成します。- パラメータ:
- peer- 実装の提供先となるピアBeanContext、このオブジェクトが自身のピアである場合はnull
 
- 
BeanContextServicesSupportpublic BeanContextServicesSupport()ほかのオブジェクトの委譲でないインスタンスを生成します。
 
- 
- 
メソッドの詳細- 
initializepublic void initialize()サブクラスの一時的な状態を初期化するために、作成時および直列化復元時にBeanContextSupportのスーパー・クラスによって呼び出されます。サブクラスはこのメソッドを包括してもかまいませんが、オーバーライドしたり直接呼び出したりすることはできません。- オーバーライド:
- initialize、クラス:- BeanContextSupport
 
- 
getBeanContextServicesPeerpublic BeanContextServices getBeanContextServicesPeer()このBeanContextServicesSupportに関連付けられているBeanContextServicesを取得します。- 戻り値:
- このオブジェクトが実装を提供するBeanContextのインスタンス。
 
- 
createBCSChildprotected BeanContextSupport.BCSChild createBCSChild(Object targetChild, Object peer)サブクラスはこのメソッドをオーバーライドすることにより、セットに子を追加するadd()メソッドやほかのCollectionメソッドをオーバーライドすることなく、Childの独自のサブクラスを挿入することができます。 - オーバーライド:
- createBCSChild、クラス:- BeanContextSupport
- パラメータ:
- targetChild- 代わりにChildを作成する子
- peer- targetChildとピアがBeanContextProxyによって関連付けられている場合はそのピア
- 戻り値:
- コレクション・メソッドをオーバーライドしない、子のサブ型固有のサブクラス
 
- 
createBCSSServiceProviderprotected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(Class<?> sc, BeanContextServiceProvider bcsp)サブクラスはこのメソッドをオーバーライドすることにより、インスタンス化するためにaddService()をオーバーライドすることなく、BCSSServiceProviderの新しいサブクラスを作成できます。- パラメータ:
- sc- クラス
- bcsp- サービス・プロバイダ
- 戻り値:
- addService()をオーバーライドしないサービス・プロバイダ
 
- 
addBeanContextServicesListenerpublic void addBeanContextServicesListener(BeanContextServicesListener bcsl)BeanContextServicesListenerを追加します。- 定義:
- addBeanContextServicesListener、インタフェース:- BeanContextServices
- パラメータ:
- bcsl- 追加する- BeanContextServicesListener
- 例外:
- NullPointerException- 引数がnullの場合
 
- 
removeBeanContextServicesListenerpublic void removeBeanContextServicesListener(BeanContextServicesListener bcsl)BeanContextServicesListenerを削除します。- 定義:
- removeBeanContextServicesListener、インタフェース:- BeanContextServices
- パラメータ:
- bcsl- このコンテキストから削除する- BeanContextServicesListener
 
- 
addServicepublic boolean addService(Class<?> serviceClass, BeanContextServiceProvider bcsp)サービスを追加します。- 定義:
- addService、インタフェース:- BeanContextServices
- パラメータ:
- serviceClass- サービス・クラス
- bcsp- サービス・プロバイダ
- 戻り値:
- サービスの追加が成功した場合はtrue、そうでない場合はfalse
 
- 
addServiceprotected boolean addService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)サービスを追加します。- パラメータ:
- serviceClass- サービス・クラス
- bcsp- サービス・プロバイダ
- fireEvent- イベントをトリガーするかどうか
- 戻り値:
- サービスが正常に追加された場合はtrue
 
- 
revokeServicepublic void revokeService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow)サービスを削除します。- 定義:
- revokeService、インタフェース:- BeanContextServices
- パラメータ:
- serviceClass- サービス・クラス
- bcsp- サービス・プロバイダ
- revokeCurrentServicesNow- サービスを取り消すかどうか
 
- 
hasServicepublic boolean hasService(Class<?> serviceClass)サービスを持ちます。そのサービスは委譲されることもあります。- 定義:
- hasService、インタフェース:- BeanContextServices
- パラメータ:
- serviceClass- 該当するサービス
- 戻り値:
- サービスが使用可能な場合はtrue
 
- 
getServicepublic Object getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersExceptionサービスを取得します。そのサービスは委譲されることもあります。- 定義:
- getService、インタフェース:- BeanContextServices
- パラメータ:
- child- このリクエストに関連付けられている- BeanContextChild
- requestor- サービスをリクエストするオブジェクト
- serviceClass- リクエストされたサービスのクラス
- serviceSelector- サービス依存パラメータ
- bcsrl- そのサービスがあとで取消しになるべき場合に通知する- BeanContextServiceRevokedListener
- 戻り値:
- リクエストされた、このコンテキストの指定されたサービスへの参照、またはnull
- 例外:
- TooManyListenersException- リスナーが多すぎる場合
 
- 
releaseServicepublic void releaseService(BeanContextChild child, Object requestor, Object service)サービスを解放します。- 定義:
- releaseService、インタフェース:- BeanContextServices
- パラメータ:
- child-- BeanContextChild
- requestor- リクエスタ
- service- サービス
 
- 
getCurrentServiceClassesインタフェースからコピーされた説明:BeanContextServicesこのコンテキストに現在使用可能なサービスを取得します。- 定義:
- getCurrentServiceClasses、インタフェース:- BeanContextServices
- 戻り値:
- 現在登録されているすべてのサービス・クラスのイテレータ。
 
- 
getCurrentServiceSelectorsインタフェースからコピーされた説明:BeanContextServices基本的なBeanContextServiceProviderのgetCurrentServiceSelectors()を呼び出すことによって、指定されたサービスのサービス依存サービス・パラメータ(Service Selectors)のリストを取得します。- 定義:
- getCurrentServiceSelectors、インタフェース:- BeanContextServices
- パラメータ:
- serviceClass- 指定されたサービス
- 戻り値:
- 指定されたサービスで使用可能な、現在登録されているすべてのサービス・セレクタ(存在する場合)のイテレータ。
 
- 
serviceAvailablepublic void serviceAvailable(BeanContextServiceAvailableEvent bcssae)BeanContextServicesListenerのコールバックです。このBeanContextServiceがまだこのサービスを実装していない場合は、現在登録されているすべてのリスナーおよびBeanContextServicesの子にイベントを送ります。サブクラスは、このメソッドをオーバーライドするか包括することで、独自の伝達セマンティックスを実装できます。- 定義:
- serviceAvailable、インタフェース:- BeanContextServicesListener
- オーバーライド:
- serviceAvailable、クラス:- BeanContextChildSupport
- パラメータ:
- bcssae- サービスが使用可能になった結果としてトリガーされたBeanContextServiceAvailableEvent
 
- 
serviceRevokedpublic void serviceRevoked(BeanContextServiceRevokedEvent bcssre)BeanContextServicesListenerのコールバックです。このBeanContextServiceがまだこのサービスを実装していない場合は、現在登録されているすべてのリスナーおよびBeanContextServicesの子にイベントを送ります。サブクラスは、このメソッドをオーバーライドするか包括することで、独自の伝達セマンティックスを実装できます。- 定義:
- serviceRevoked、インタフェース:- BeanContextServiceRevokedListener
- オーバーライド:
- serviceRevoked、クラス:- BeanContextChildSupport
- パラメータ:
- bcssre- サービスの取消しの結果としてトリガーされた- BeanContextServiceRevokedEvent
 
- 
getChildBeanContextServicesListenerprotected static final BeanContextServicesListener getChildBeanContextServicesListener(Object child)指定された子のBeanContextServicesListener(存在する場合)を取得します。- パラメータ:
- child- 指定された子
- 戻り値:
- 指定された子のBeanContextServicesListener (存在する場合)
 
- 
childJustRemovedHookprotected void childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)子が正常に削除された後で、スーパー・クラスの子削除操作から呼び出されます。子が同期された状態で呼び出されます。 このサブクラスはこのフックを使用して、子によって使用されているサービスを即座に取り消します(BeanContextChildの場合)。サブクラスは、自身の子の削除の副作用を実装するためにこのメソッドを包括できます。- オーバーライド:
- childJustRemovedHook、クラス:- BeanContextSupport
- パラメータ:
- child- 子
- bcsc- BCSChild
 
- 
releaseBeanContextResourcesprotected void releaseBeanContextResources()入れ子になっているBeanContextから取得したリソースを解放するようBeanContextChildに通知するために、setBeanContextから呼び出されます。 このメソッドは親から取得したサービスを取り消します。サブクラスは、独自のセマンティックスを実装するためにこのメソッドをエンベロープできます。- オーバーライド:
- releaseBeanContextResources、クラス:- BeanContextChildSupport
 
- 
initializeBeanContextResourcesprotected void initializeBeanContextResources()入れ子になっているBeanContextから取得したリソースを割り当てるようBeanContextChildに通知するために、setBeanContextから呼び出されます。サブクラスは、このメソッドを包括することで独自のセマンティックスを実装できます。- オーバーライド:
- initializeBeanContextResources、クラス:- BeanContextChildSupport
 
- 
fireServiceAddedprotected final void fireServiceAdded(Class<?> serviceClass)新しいサービスを通知するBeanContextServiceEventをトリガーします。- パラメータ:
- serviceClass- サービス・クラス
 
- 
fireServiceAddedprotected final void fireServiceAdded(BeanContextServiceAvailableEvent bcssae)新しいサービスが利用可能になったことを示すBeanContextServiceAvailableEventをトリガーします。- パラメータ:
- bcssae-- BeanContextServiceAvailableEvent
 
- 
fireServiceRevokedprotected final void fireServiceRevoked(BeanContextServiceRevokedEvent bcsre)サービスの取消しを通知するBeanContextServiceEventをトリガーします。- パラメータ:
- bcsre-- BeanContextServiceRevokedEvent
 
- 
fireServiceRevokedprotected final void fireServiceRevoked(Class<?> serviceClass, boolean revokeNow)特定のサービスが利用できなくなったことを示すBeanContextServiceRevokedEventをトリガーします。- パラメータ:
- serviceClass- サービス・クラス
- revokeNow- イベントを今すぐ取り消すかどうか
 
- 
bcsPreSerializationHookprotected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOExceptionBeanContextSupport writeObjectが子を直列化する前に、BeanContextSupport writeObjectによって呼び出されます。このクラスは、ここにあるどのSerializable BeanContextServiceProvidersも直列化します。サブクラスは、このメソッドを包括して、子の直列化より前に行う必要のある自身の直列化処理を挿入できます。- オーバーライド:
- bcsPreSerializationHook、クラス:- BeanContextSupport
- パラメータ:
- oos- 直列化中に使用する- ObjectOutputStream
- 例外:
- IOException- 直列化に失敗した場合
 
- 
bcsPreDeserializationHookprotected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundExceptionBeanContextSupport readObjectが子を直列化する前に、BeanContextSupport readObjectによって呼び出されます。このクラスは、以前に直列化されたどのSerializable BeanContextServiceProvidersも直列化復元するので、子は直列化復元されるときにSerializable BeanContextServiceProvidersを使用できます。サブクラスは、このメソッドを包括して、子の直列化より前に行う必要のある自身の直列化処理を挿入できます。- オーバーライド:
- bcsPreDeserializationHook、クラス:- BeanContextSupport
- パラメータ:
- ois- 直列化復元中に使用する- ObjectInputStream
- 例外:
- IOException- 直列化復元が失敗した場合
- ClassNotFoundException- 必要なクラスが見つからない場合
 
 
-