java.lang.Objectjava.beans.beancontext.BeanContextChildSupport
java.beans.beancontext.BeanContextSupport
java.beans.beancontext.BeanContextServicesSupport
public class BeanContextServicesSupport
此帮助器类提供 java.beans.beancontext.BeanContextServices 接口的实用工具实现。
因为此类直接实现 BeanContextServices 接口,所以可以通过创建此实现的子类来使用该类,或者由通过 BeanContextProxy 接口的另一个实例对此类实例的委托来使用该类。
| 嵌套类摘要 | |
|---|---|
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) 使用指定 Locale 和设计模式创建一个实例。 |
|
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 中调用。 |
protected void |
bcsPreSerializationHook(ObjectOutputStream oos) 在序列化子级之前,从 BeanContextSupport writeObject 中调用。 |
protected void |
childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc) 在已成功移除子级之后,从超类的子级移除操作中调用。 |
protected BeanContextSupport.BCSChild |
createBCSChild(Object targetChild, Object peer) 子类可以重写此方法来插入自己的 Child 的子类,而不必重写 add() 或其他将子级添加到集合中的 Collection 方法。 |
protected BeanContextServicesSupport.BCSSServiceProvider |
createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp) 子类可以重写此方法来创建 BCSSServiceProvider 的新子类,而不必为了实例化而重写 addService()。 |
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() 获得指定服务的与服务有关的服务参数列表(服务选择器)。 |
Object |
getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) 获得一个可被委托的服务。 |
boolean |
hasService(Class serviceClass) 具有一个可被委托的服务。 |
void |
initialize() 由 BeanContextSupport 超类在构造和反序列化期间调用,以初始化子类的瞬态。 |
protected void |
initializeBeanContextResources() 从 setBeanContext 中调用,以通知 BeanContextChild 分配从嵌套 BeanContext 中获得的资源。 |
protected void |
releaseBeanContextResources() 从 setBeanContext 中调用,以通知 BeanContextChild 释放从嵌套 BeanContext 中获得的资源。 |
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 回调,如果此 BeanContextService 自己尚未实现此服务,则将事件传播到所有当前已注册侦听器和 BeanContextServices 子级。 |
void |
serviceRevoked(BeanContextServiceRevokedEvent bcssre) BeanContextServicesListener 回调,如果此 BeanContextService 自己尚未实现此服务,则将事件传播到所有当前已注册侦听器和 BeanContextServices 子级。 |
| 从类 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 |
| 字段详细信息 |
|---|
protected transient HashMap services
protected transient HashMap services 字段的所有访问在该对象上都应该是同步的。
protected transient int serializable
protected transient BeanContextServicesSupport.BCSSProxyServiceProvider proxy
protected transient ArrayList bcsListeners
| 构造方法详细信息 |
|---|
public BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dTime, boolean visible)
构造一个 BeanContextServicesSupport 实例
peer - 将为其提供实现的同位体 BeanContext,如果该参数为 null,则此对象是它自己的同位体
lcle - 此 BeanContext 的当前 Locale。
dtime - 初始状态,如果在设计模式下,则该参数为 true,如果在运行状态下,则该参数为 false。
visible - 初始可见性。
public BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dtime)
peer - 将为其提供实现的同位体 BeanContext,如果该参数为 null,则此对象是它自己的同位体
lcle - 此 BeanContext 的当前 Locale。
dtime - 初始状态,如果在设计模式下,则该参数为 true,如果在运行状态下,则该参数为 false。
public BeanContextServicesSupport(BeanContextServices peer, Locale lcle)
peer - 将为其提供实现的同位体 BeanContext,如果该参数为 null,则此对象是它自己的同位体
lcle - 此 BeanContext 的当前 Locale。
public BeanContextServicesSupport(BeanContextServices peer)
peer - 将为其提供实现的同位体 BeanContext,如果该参数为 null,则此对象是它自己的同位体。
public BeanContextServicesSupport()
| 方法详细信息 |
|---|
public void initialize()
BeanContextSupport 中的
initialize
public BeanContextServices getBeanContextServicesPeer()
protected BeanContextSupport.BCSChild createBCSChild(Object targetChild, Object peer)
子类可以重写此方法来插入自己的 Child 的子类,而不必重写 add() 或其他将子级添加到集合中的 Collection 方法。
BeanContextSupport 中的
createBCSChild
targetChild - 要创建自己的 Child 的子级
peer - 同位体,如果 targetChild 和同位体通过 BeanContextProxy 建立联系
protected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp)
public void addBeanContextServicesListener(BeanContextServicesListener bcsl)
bcsl - 要添加的
BeanContextServicesListener
public void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
bcsl - 要从此上下文移除的
BeanContextServicesListener
public boolean addService(Class serviceClass, BeanContextServiceProvider bcsp)
BeanContextServices 中的
addService
serviceClass - 要添加的服务
bcsp - 与该服务相关联的
BeanContextServiceProvider
protected boolean addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)