JavaTM Platform
Standard Ed. 6

java.beans.beancontext
クラス BeanContextServicesSupport

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  class BeanContextServicesSupport.BCSSChild
           
protected  class BeanContextServicesSupport.BCSSProxyServiceProvider
           
protected static class BeanContextServicesSupport.BCSSServiceProvider
          サブクラスは、この入れ子構造のクラスをサブクラス化して、各 BeanContextServicesProvider の動作を追加できます。
 
クラス java.beans.beancontext.BeanContextSupport から継承された入れ子のクラス/インタフェース
BeanContextSupport.BCSChild, BeanContextSupport.BCSIterator
 
フィールドの概要
protected  ArrayList bcsListeners
          BeanContextServicesListener オブジェクトのリストです。
protected  BeanContextServicesSupport.BCSSProxyServiceProvider proxy
          BeanContextServiceProvider の委譲です。
protected  int serializable
          直列化可能な BeanContextServceProvider のインスタンスの数です。
protected  HashMap services
          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()
          ほかのオブジェクトの委譲でないインスタンスを生成します。
BeanContextServicesSupport(BeanContextServices peer)
          ピアを使ってインスタンスを生成します。
BeanContextServicesSupport(BeanContextServices peer, Locale lcle)
          指定されたロケールを使ってインスタンスを生成します。
BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dtime)
          指定されたロケールを使って設計モードでインスタンスを生成します。
BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dTime, boolean visible)
           BeanContextServicesSupport のインスタンスを生成します。
 
メソッドの概要
 void addBeanContextServicesListener(BeanContextServicesListener bcsl)
          BeanContextServicesListener を追加します。
 boolean addService(Class serviceClass, BeanContextServiceProvider bcsp)
          サービスを追加します。
protected  boolean addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)
          サービスを追加します。
protected  void bcsPreDeserializationHook(ObjectInputStream ois)
          BeanContextSupport readObject が子を直列化する前に、BeanContextSupport readObject によって呼び出されます。
protected  void bcsPreSerializationHook(ObjectOutputStream oos)
          BeanContextSupport writeObject が子を直列化する前に、BeanContextSupport writeObject によって呼び出されます。
protected  void childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
          子が正常に削除されたあとで、スーパークラスの子削除操作から呼び出されます。
protected  BeanContextSupport.BCSChild createBCSChild(Object targetChild, Object peer)
           サブクラスはこのメソッドをオーバーライドすることにより、セットに子を追加する add() メソッドやほかの Collection メソッドをオーバーライドすることなく、Child の独自のサブクラスを挿入することができます。
protected  BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp)
          サブクラスはこのメソッドをオーバーライドすることにより、インスタンス生成のために addService() をオーバーライドすることなく、BCSSServiceProvider の新しいサブクラスを生成することができます。
protected  void fireServiceAdded(BeanContextServiceAvailableEvent bcssae)
          新しいサービスが使用可能になったことを示す BeanContextServiceAvailableEvent をトリガーします。
protected  void fireServiceAdded(Class serviceClass)
          新しいサービスを通知する BeanContextServiceEvent をトリガーします。
protected  void fireServiceRevoked(BeanContextServiceRevokedEvent bcsre)
          サービスの取り消しを通知する BeanContextServiceEvent をトリガーします。
protected  void fireServiceRevoked(Class serviceClass, boolean revokeNow)
          特定のサービスが使用不可になったことを通知する BeanContextServiceRevokedEvent をトリガーします。
 BeanContextServices getBeanContextServicesPeer()
          この BeanContextServicesSupport に関連した BeanContextServices を取得します。
protected static BeanContextServicesListener getChildBeanContextServicesListener(Object child)
          指定された子の BeanContextServicesListener (存在する場合) を取得します。
 Iterator getCurrentServiceClasses()
          このコンテキストに現在使用可能なサービスを取得します。
 Iterator getCurrentServiceSelectors(Class serviceClass)
          基本的な BeanContextServiceProvider の getCurrentServiceSelectors() を呼び出すことによって、指定されたサービスのサービス依存サービスパラメータ (Service Selectors) のリストを取得します。
 Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl)
          サービスを取得します。
 boolean hasService(Class serviceClass)
          サービスを持ちます。
 void initialize()
          サブクラスの一時的な状態を初期化するために、作成時および直列化復元時に BeanContextSupport のスーパークラスによって呼び出されます。
protected  void initializeBeanContextResources()
          入れ子になっている BeanContext から取得したリソースを割り当てるよう BeanContextChild に通知するために、setBeanContext から呼び出されます。
protected  void releaseBeanContextResources()
          入れ子になっている BeanContext から取得したリソースを解放するよう BeanContextChild に通知するために、setBeanContext から呼び出されます。
 void releaseService(BeanContextChild child, Object requestor, Object service)
          サービスを解放します。
 void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
          BeanContextServicesListener を削除します。
 void revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow)
          サービスを削除します。
 void serviceAvailable(BeanContextServiceAvailableEvent bcssae)
          BeanContextServicesListener のコールバックです。
 void serviceRevoked(BeanContextServiceRevokedEvent bcssre)
          BeanContextServicesListener のコールバックです。
 
クラス 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, remove, removeAll, retainAll, size, toArray, toArray
 
インタフェース java.beans.DesignMode から継承されたメソッド
isDesignTime, setDesignTime
 
インタフェース java.beans.Visibility から継承されたメソッド
avoidingGui, dontUseGui, needsGui, okToUseGui
 

フィールドの詳細

services

protected transient HashMap services
protected transient HashMap services フィールドへのすべてのアクセスは、そのオブジェクトに同期化されます。


serializable

protected transient int serializable
直列化可能な BeanContextServceProvider のインスタンスの数です。


proxy

protected transient BeanContextServicesSupport.BCSSProxyServiceProvider proxy
BeanContextServiceProvider の委譲です。


bcsListeners

protected transient ArrayList bcsListeners
BeanContextServicesListener オブジェクトのリストです。

コンストラクタの詳細

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale lcle,
                                  boolean dTime,
                                  boolean visible)

BeanContextServicesSupport のインスタンスを生成します。

パラメータ:
peer - 実装の提供先となるピア BeanContext。このオブジェクトが自身のピアである場合は null
lcle - この BeanContext の現在の Locale
dtime - 初期状態。設計モードの場合は true、実行時モードの場合は false
visible - 初期状態での可視性

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale lcle,
                                  boolean dtime)
指定されたロケールを使って設計モードでインスタンスを生成します。

パラメータ:
peer - 実装の提供先となるピア BeanContext。このオブジェクトが自身のピアである場合は null
lcle - この BeanContext の現在の Locale
dtime - 初期状態。設計モードの場合は true、実行時モードの場合は false

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale lcle)
指定されたロケールを使ってインスタンスを生成します。

パラメータ:
peer - 実装の提供先となるピア BeanContext。このオブジェクトが自身のピアである場合は null
lcle - この BeanContext の現在の Locale

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer)
ピアを使ってインスタンスを生成します。

パラメータ:
peer - 実装の提供先となるピア BeanContext。このオブジェクトが自身のピアである場合は null

BeanContextServicesSupport

public BeanContextServicesSupport()
ほかのオブジェクトの委譲でないインスタンスを生成します。

メソッドの詳細

initialize

public void initialize()
サブクラスの一時的な状態を初期化するために、作成時および直列化復元時に BeanContextSupport のスーパークラスによって呼び出されます。 サブクラスはこのメソッドを包括してもかまいませんが、オーバーライドしたり直接呼び出したりすることはできません。

オーバーライド:
クラス BeanContextSupport 内の initialize

getBeanContextServicesPeer

public BeanContextServices getBeanContextServicesPeer()
この BeanContextServicesSupport に関連した BeanContextServices を取得します。

戻り値:
このオブジェクトが実装を提供する BeanContext のインスタンス

createBCSChild

protected BeanContextSupport.BCSChild createBCSChild(Object targetChild,
                                                     Object peer)

サブクラスはこのメソッドをオーバーライドすることにより、セットに子を追加する add() メソッドやほかの Collection メソッドをオーバーライドすることなく、Child の独自のサブクラスを挿入することができます。

オーバーライド:
クラス BeanContextSupport 内の createBCSChild
パラメータ:
targetChild - Child を作成する子
peer - targetChild とピアが BeanContextProxy によって関連付けられている場合はそのピア

createBCSSServiceProvider

protected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(Class sc,
                                                                                   BeanContextServiceProvider bcsp)
サブクラスはこのメソッドをオーバーライドすることにより、インスタンス生成のために addService() をオーバーライドすることなく、BCSSServiceProvider の新しいサブクラスを生成することができます。


addBeanContextServicesListener

public void addBeanContextServicesListener(BeanContextServicesListener bcsl)
BeanContextServicesListener を追加します。

定義:
インタフェース BeanContextServices 内の addBeanContextServicesListener
パラメータ:
bcsl - 追加する BeanContextServicesListener

removeBeanContextServicesListener

public void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
BeanContextServicesListener を削除します。

定義:
インタフェース BeanContextServices 内の removeBeanContextServicesListener
パラメータ:
bcsl - このコンテキストから削除する BeanContextServicesListener

addService

public boolean addService(Class serviceClass,
                          BeanContextServiceProvider bcsp)
サービスを追加します。

定義:
インタフェース BeanContextServices 内の addService
パラメータ:
serviceClass - 追加するサービス
bcsp - サービスに関連した BeanContextServiceProvider

addService

protected boolean addService(Class serviceClass,
                             BeanContextServiceProvider bcsp,
                             boolean fireEvent)
サービスを追加します。


revokeService

public void revokeService(Class serviceClass,
                          BeanContextServiceProvider bcsp,
                          boolean revokeCurrentServicesNow)
サービスを削除します。

定義:
インタフェース BeanContextServices 内の revokeService
パラメータ:
serviceClass - この BeanContextServices から呼び出すサービス
bcsp - 無効になるこの特定のサービスに関連した BeanContextServiceProvider
revokeCurrentServicesNow - true の値は、BeanContextServiceProvider または BeanContextServices が、指定されたサービスへの現在未処理の参照すべてに対してサービスを直ちに終了しようとしている例外状況を示す

hasService

public boolean hasService(Class serviceClass)
サービスを持ちます。そのサービスは委譲されることもあります。

定義:
インタフェース BeanContextServices 内の hasService
パラメータ:
serviceClass - 該当するサービス
戻り値:
サービスが使用可能な場合は true

getService

public Object getService(BeanContextChild child,
                         Object requestor,
                         Class serviceClass,
                         Object serviceSelector,
                         BeanContextServiceRevokedListener bcsrl)
                  throws TooManyListenersException
サービスを取得します。そのサービスは委譲されることもあります。

定義:
インタフェース BeanContextServices 内の getService
パラメータ:
child - この要求に関連した BeanContextChild
requestor - サービスを要求するオブジェクト
serviceClass - 要求されたサービスのクラス
serviceSelector - サービス依存パラメータ
bcsrl - あとで無効にする必要がある場合に通知する BeanContextServiceRevokedListener
戻り値:
要求された、このコンテキストの指定された Service への参照、または null
例外:
TooManyListenersException

releaseService

public void releaseService(BeanContextChild child,
                           Object requestor,
                           Object service)
サービスを解放します。

定義:
インタフェース BeanContextServices 内の releaseService
パラメータ:
child - BeanContextChild
requestor - 要求者
service - サービス

getCurrentServiceClasses

public Iterator getCurrentServiceClasses()
インタフェース BeanContextServices の記述:
このコンテキストに現在使用可能なサービスを取得します。

定義:
インタフェース BeanContextServices 内の getCurrentServiceClasses
戻り値:
現在登録されているすべてのサービスクラスの反復子

getCurrentServiceSelectors

public Iterator getCurrentServiceSelectors(Class serviceClass)
インタフェース BeanContextServices の記述:
基本的な BeanContextServiceProvider の getCurrentServiceSelectors() を呼び出すことによって、指定されたサービスのサービス依存サービスパラメータ (Service Selectors) のリストを取得します。

定義:
インタフェース BeanContextServices 内の getCurrentServiceSelectors
パラメータ:
serviceClass - 指定されたサービス
戻り値:
指定されたサービスで使用可能な、現在登録されているすべてのサービスセレクタ (存在する場合) の反復子

serviceAvailable

public void serviceAvailable(BeanContextServiceAvailableEvent bcssae)
BeanContextServicesListener のコールバックです。この BeanContextService がまだこのサービスを実装していない場合は、現在登録されているすべてのリスナーおよび BeanContextServices の子にイベントを送ります。 サブクラスは、このメソッドをオーバーライドするか包括することで、独自の伝達セマンティクスを実装できます。

定義:
インタフェース BeanContextServicesListener 内の serviceAvailable
オーバーライド:
クラス BeanContextChildSupport 内の serviceAvailable
パラメータ:
bcssae - サービスが使用可能になったためにトリガーされた BeanContextServiceAvailableEvent

serviceRevoked

public void serviceRevoked(BeanContextServiceRevokedEvent bcssre)
BeanContextServicesListener のコールバックです。この BeanContextService がまだこのサービスを実装していない場合は、現在登録されているすべてのリスナーおよび BeanContextServices の子にイベントを送ります。 サブクラスは、このメソッドをオーバーライドするか包括することで、独自の伝達セマンティクスを実装できます。

定義:
インタフェース BeanContextServiceRevokedListener 内の serviceRevoked
オーバーライド:
クラス BeanContextChildSupport 内の serviceRevoked
パラメータ:
bcssre - サービスの取り消しによってトリガーされた BeanContextServiceRevokedEvent

getChildBeanContextServicesListener

protected static final BeanContextServicesListener getChildBeanContextServicesListener(Object child)
指定された子の BeanContextServicesListener (存在する場合) を取得します。

パラメータ:
child - 指定された子
戻り値:
指定された子の BeanContextServicesListener (存在する場合)

childJustRemovedHook

protected void childJustRemovedHook(Object child,
                                    BeanContextSupport.BCSChild bcsc)
子が正常に削除されたあとで、スーパークラスの子削除操作から呼び出されます。子を同期化して呼び出されます。 子が BeanContextChild である場合、このクラスはこの子が使用しているサービスを、このフックを使って直ちに無効にします。 サブクラスは、子の削除に関する独自の副作用を実装するためにこのメソッドを包括することができます。

オーバーライド:
クラス BeanContextSupport 内の childJustRemovedHook

releaseBeanContextResources

protected void releaseBeanContextResources()
入れ子になっている BeanContext から取得したリソースを解放するよう BeanContextChild に通知するために、setBeanContext から呼び出されます。 このメソッドは、親から取得したどのサービスも無効にします。 サブクラスは、このメソッドを包括することで独自のセマンティクスを実装できます。

オーバーライド:
クラス BeanContextChildSupport 内の releaseBeanContextResources

initializeBeanContextResources

protected void initializeBeanContextResources()
入れ子になっている BeanContext から取得したリソースを割り当てるよう BeanContextChild に通知するために、setBeanContext から呼び出されます。 サブクラスは、このメソッドを包括することで独自のセマンティクスを実装できます。

オーバーライド:
クラス BeanContextChildSupport 内の initializeBeanContextResources

fireServiceAdded

protected final void fireServiceAdded(Class serviceClass)
新しいサービスを通知する BeanContextServiceEvent をトリガーします。


fireServiceAdded

protected final void fireServiceAdded(BeanContextServiceAvailableEvent bcssae)
新しいサービスが使用可能になったことを示す BeanContextServiceAvailableEvent をトリガーします。

パラメータ:
bcssae - BeanContextServiceAvailableEvent

fireServiceRevoked

protected final void fireServiceRevoked(BeanContextServiceRevokedEvent bcsre)
サービスの取り消しを通知する BeanContextServiceEvent をトリガーします。

パラメータ:
bcsre - BeanContextServiceRevokedEvent

fireServiceRevoked

protected final void fireServiceRevoked(Class serviceClass,
                                        boolean revokeNow)
特定のサービスが使用不可になったことを通知する BeanContextServiceRevokedEvent をトリガーします。


bcsPreSerializationHook

protected void bcsPreSerializationHook(ObjectOutputStream oos)
                                throws IOException
BeanContextSupport writeObject が子を直列化する前に、BeanContextSupport writeObject によって呼び出されます。 このクラスは、ここにあるどの Serializable BeanContextServiceProviders も直列化します。 サブクラスは、このメソッドを包括して、子の直列化より前に行う必要のある自身の直列化処理を挿入できます。

オーバーライド:
クラス BeanContextSupport 内の bcsPreSerializationHook
例外:
IOException

bcsPreDeserializationHook

protected void bcsPreDeserializationHook(ObjectInputStream ois)
                                  throws IOException,
                                         ClassNotFoundException
BeanContextSupport readObject が子を直列化する前に、BeanContextSupport readObject によって呼び出されます。 このクラスは、以前に直列化されたどの Serializable BeanContextServiceProviders も直列化復元するので、子は直列化復元されるときに Serializable BeanContextServiceProviders を使用できます。 サブクラスは、このメソッドを包括して、子の直列化より前に行う必要のある自身の直列化処理を挿入できます。

オーバーライド:
クラス BeanContextSupport 内の bcsPreDeserializationHook
例外:
IOException
ClassNotFoundException

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。