APIdia Launch Partner
Top Description Inners Fields Constructors Methods
java.beans.beancontext

public Class BeanContextServicesSupport

extends BeanContextSupport
implements BeanContextServices
Class Inheritance
All Implemented Interfaces
java.beans.beancontext.BeanContextServices, java.beans.beancontext.BeanContextServicesListener, java.beans.beancontext.BeanContextServiceRevokedListener, java.util.EventListener, java.beans.beancontext.BeanContext, java.beans.Visibility, java.beans.DesignMode, java.util.Collection, java.lang.Iterable, java.beans.beancontext.BeanContextChild
Annotations
@SuppressWarnings:removal
@Deprecated
since:23
forRemoval:true
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serial, .Serializable, java.util.ArrayList, .Collection, .HashMap, .HashSet, .Iterator, .Locale, .Map, .TooManyListenersException

Deprecated

for removal since 23.

This helper class provides a utility implementation of the java.beans.beancontext.BeanContextServices interface.

Since this class directly implements the BeanContextServices interface, the class can, and is intended to be used either by subclassing this implementation, or via delegation of an instance of this class from another through the BeanContextProxy interface.

Author
Laurence P. G. Cable
Since
1.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
BeanContextServicesSupport.BCSSChild

A protected nested class containing per-child information in the children hashtable.

protected class
BeanContextServicesSupport.BCSSProxyServiceProvider

References Deprecated BeanContextServiceProvider and BeanContextServiceRevokedListener are deprecated or reference (maybe indirectly) at least one deprecated element.
Subclasses may subclass this nested class to represent a proxy for each BeanContextServiceProvider.
protected static class
BeanContextServicesSupport.BCSSServiceProvider

subclasses may subclass this nested class to add behaviors for each BeanContextServicesProvider.

Field Summary

Modifier and TypeField and Description
protected transient ArrayList<BeanContextServicesListener>
bcsListeners

List of BeanContextServicesListener objects.

protected transient BeanContextServicesSupport.BCSSProxyServiceProvider
proxy

References Deprecated BeanContextServicesSupport.BCSSProxyServiceProvider is deprecated or references (maybe indirectly) at least one deprecated element.
Delegate for the BeanContextServiceProvider.
protected transient int
serializable

Hides java.beans.beancontext.BeanContextSupport.serializable.

The number of instances of a serializable BeanContextServceProvider.
private static final long
serialVersionUID

Hides java.beans.beancontext.BeanContextSupport.serialVersionUID.

Use serialVersionUID from JDK 1.7 for interoperability.
protected transient HashMap<Object, BeanContextServicesSupport.BCSSServiceProvider>
services

all accesses to the protected transient HashMap services field should be synchronized on that object

Inherited from java.beans.beancontext.BeanContextSupport:
bcmListenerschildrendesignTimelocaleokToUseGui

Constructor Summary

AccessConstructor and Description
public
BeanContextServicesSupport(BeanContextServices
The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
peer
,
Locale
The current Locale for this BeanContext.
lcle
,
boolean
The initial state, true if in design mode, false if runtime.
dTime
,
boolean
The initial visibility.
visible
)
References Deprecated BeanContextServices is deprecated or references (maybe indirectly) at least one deprecated element.

Construct a BeanContextServicesSupport instance

public
BeanContextServicesSupport(BeanContextServices
The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
peer
,
Locale
The current Locale for this BeanContext.
lcle
,
boolean
The initial state, true if in design mode, false if runtime.
dtime
)
References Deprecated BeanContextServices is deprecated or references (maybe indirectly) at least one deprecated element.

Create an instance using the specified Locale and design mode.

public
BeanContextServicesSupport(BeanContextServices
The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
peer
,
Locale
The current Locale for this BeanContext.
lcle
)
References Deprecated BeanContextServices is deprecated or references (maybe indirectly) at least one deprecated element.

Create an instance using the specified locale

public
BeanContextServicesSupport(BeanContextServices
The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
peer
)
References Deprecated BeanContextServices is deprecated or references (maybe indirectly) at least one deprecated element.

Create an instance with a peer

public
BeanContextServicesSupport()

Create an instance that is not a delegate of another object

Method Summary

Modifier and TypeMethod and Description
public void
addBeanContextServicesListener(BeanContextServicesListener bcsl)

Implements java.beans.beancontext.BeanContextServices.addBeanContextServicesListener.

References Deprecated BeanContextServicesListener is deprecated or references (maybe indirectly) at least one deprecated element.

add a BeanContextServicesListener

public boolean
addService(Class<?>
the service class
serviceClass
,
BeanContextServiceProvider
the service provider
bcsp
)

Implements java.beans.beancontext.BeanContextServices.addService.

References Deprecated BeanContextServiceProvider is deprecated or references (maybe indirectly) at least one deprecated element.

add a service

protected boolean

Returns:

true if the service was successfully added
addService
(Class<?>
the service class
serviceClass
,
BeanContextServiceProvider
the service provider
bcsp
,
boolean
whether or not an event should be fired
fireEvent
)
References Deprecated BeanContextServiceProvider is deprecated or references (maybe indirectly) at least one deprecated element.

add a service

protected synchronized void
bcsPreDeserializationHook(ObjectInputStream ois)

Overrides java.beans.beancontext.BeanContextSupport.bcsPreDeserializationHook.

called from BeanContextSupport readObject before it deserializes the children ...

protected synchronized void
bcsPreSerializationHook(ObjectOutputStream oos)

Overrides java.beans.beancontext.BeanContextSupport.bcsPreSerializationHook.

called from BeanContextSupport writeObject before it serializes the children ...

protected void
childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)

Overrides java.beans.beancontext.BeanContextSupport.childJustRemovedHook.

called from superclass child removal operations after a child has been successfully removed.

protected BeanContextSupport.BCSChild
createBCSChild(Object
the child to create the Child on behalf of
targetChild
,
Object
the peer if the targetChild and peer are related by BeanContextProxy
peer
)

Overrides java.beans.beancontext.BeanContextSupport.createBCSChild.

Subclasses can override this method to insert their own subclass of Child without having to override add() or the other Collection methods that add children to the set.

protected BeanContextServicesSupport.BCSSServiceProvider

Returns:

a service provider without overriding addService()
createBCSSServiceProvider
(Class<?>
the class
sc
,
BeanContextServiceProvider
the service provider
bcsp
)
References Deprecated BeanContextServiceProvider is deprecated or references (maybe indirectly) at least one deprecated element.

subclasses can override this method to create new subclasses of BCSSServiceProvider without having to override addService() in order to instantiate.

protected final void
fireServiceAdded(Class<?>
the service class
serviceClass
)

Fires a BeanContextServiceEvent notifying of a new service.

protected final void
fireServiceAdded(BeanContextServiceAvailableEvent
the BeanContextServiceAvailableEvent
bcssae
)
References Deprecated BeanContextServiceAvailableEvent is deprecated or references (maybe indirectly) at least one deprecated element.

Fires a BeanContextServiceAvailableEvent indicating that a new service has become available.

protected final void
fireServiceRevoked(BeanContextServiceRevokedEvent
the BeanContextServiceRevokedEvent
bcsre
)
References Deprecated BeanContextServiceRevokedEvent is deprecated or references (maybe indirectly) at least one deprecated element.

Fires a BeanContextServiceEvent notifying of a service being revoked.

protected final void
fireServiceRevoked(Class<?>
the service class
serviceClass
,
boolean
whether or not the event should be revoked now
revokeNow
)

Fires a BeanContextServiceRevokedEvent indicating that a particular service is no longer available.

public BeanContextServices

Returns:

the instance of BeanContext this object is providing the implementation for.
getBeanContextServicesPeer
()
References Deprecated BeanContextServices is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the BeanContextServices associated with this BeanContextServicesSupport.

protected static final BeanContextServicesListener

Returns:

the BeanContextServicesListener (if any) of the specified child
getChildBeanContextServicesListener
(Object
the specified child
child
)
References Deprecated BeanContextServicesListener is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the BeanContextServicesListener (if any) of the specified child.

public Iterator<Object>

Returns:

an iterator for all the currently registered service classes.
getCurrentServiceClasses
()

Implements java.beans.beancontext.BeanContextServices.getCurrentServiceClasses.

Gets the currently available services for this context.

public Iterator<?>

Returns:

an iterator for all the currently available service selectors (if any) available for the specified service.
getCurrentServiceSelectors
(Class<?> serviceClass)

Implements java.beans.beancontext.BeanContextServices.getCurrentServiceSelectors.

Gets the list of service dependent service parameters (Service Selectors) for the specified service, by calling getCurrentServiceSelectors() on the underlying BeanContextServiceProvider.

public Object
getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl)

Implements java.beans.beancontext.BeanContextServices.getService.

References Deprecated BeanContextChild and BeanContextServiceRevokedListener are deprecated or reference (maybe indirectly) at least one deprecated element.

obtain a service which may be delegated

public synchronized boolean
hasService(Class<?> serviceClass)

Implements java.beans.beancontext.BeanContextServices.hasService.

has a service, which may be delegated

public void
initialize()

Overrides java.beans.beancontext.BeanContextSupport.initialize.

called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state.

protected synchronized void
initializeBeanContextResources()

Overrides java.beans.beancontext.BeanContextChildSupport.initializeBeanContextResources.

called from setBeanContext to notify a BeanContextChild to allocate resources obtained from the nesting BeanContext.

private synchronized void
readObject(ObjectInputStream
the ObjectInputStream to read
ois
)

Hides java.beans.beancontext.BeanContextSupport.readObject.

Deserialize the instance.

protected synchronized void
releaseBeanContextResources()

Overrides java.beans.beancontext.BeanContextChildSupport.releaseBeanContextResources.

called from setBeanContext to notify a BeanContextChild to release resources obtained from the nesting BeanContext.

public void
releaseService(BeanContextChild child, Object requestor, Object service)

Implements java.beans.beancontext.BeanContextServices.releaseService.

References Deprecated BeanContextChild is deprecated or references (maybe indirectly) at least one deprecated element.

release a service

public void
removeBeanContextServicesListener(BeanContextServicesListener bcsl)

Implements java.beans.beancontext.BeanContextServices.removeBeanContextServicesListener.

References Deprecated BeanContextServicesListener is deprecated or references (maybe indirectly) at least one deprecated element.

remove a BeanContextServicesListener

public void
revokeService(Class<?>
the service class
serviceClass
,
BeanContextServiceProvider
the service provider
bcsp
,
boolean
whether or not to revoke the service
revokeCurrentServicesNow
)

Implements java.beans.beancontext.BeanContextServices.revokeService.

References Deprecated BeanContextServiceProvider is deprecated or references (maybe indirectly) at least one deprecated element.

remove a service

public void
serviceAvailable(BeanContextServiceAvailableEvent bcssae)

Overrides java.beans.beancontext.BeanContextChildSupport.serviceAvailable.

Implements java.beans.beancontext.BeanContextServicesListener.serviceAvailable.

References Deprecated BeanContextServiceAvailableEvent is deprecated or references (maybe indirectly) at least one deprecated element.

BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself.

public void
serviceRevoked(BeanContextServiceRevokedEvent bcssre)

Overrides java.beans.beancontext.BeanContextChildSupport.serviceRevoked.

Implements java.beans.beancontext.BeanContextServiceRevokedListener.serviceRevoked.

References Deprecated BeanContextServiceRevokedEvent is deprecated or references (maybe indirectly) at least one deprecated element.

BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself.

private synchronized void
writeObject(ObjectOutputStream
the ObjectOutputStream to write
oos
)

Hides java.beans.beancontext.BeanContextSupport.writeObject.

Serialize the instance.

Inherited from java.beans.beancontext.BeanContextSupport:
addaddAlladdBeanContextMembershipListeneravoidingGuibcsChildrenchildDeserializedHookchildJustAddedHookclassEqualsclearcontainscontainsAllcontainsKeycopyChildrendeserializedontUseGuifireChildrenAddedfireChildrenRemovedgetBeanContextPeergetChildBeanContextChildgetChildBeanContextMembershipListenergetChildPropertyChangeListenergetChildSerializablegetChildVetoableChangeListenergetChildVisibilitygetLocalegetResourcegetResourceAsStreaminstantiateChildisDesignTimeisEmptyisSerializingiteratorneedsGuiokToUseGuipropertyChangereadChildrenremoveremoveremoveAllremoveBeanContextMembershipListenerretainAllserializesetDesignTimesetLocalesizetoArraytoArrayvalidatePendingAddvalidatePendingRemovevetoableChangewriteChildren