Class BeanContextServicesSupport
java.lang.Object
java.beans.beancontext.BeanContextChildSupport
java.beans.beancontext.BeanContextSupport
java.beans.beancontext.BeanContextServicesSupport
- All Implemented Interfaces:
- BeanContext,- BeanContextChild,- BeanContextServiceRevokedListener,- BeanContextServices,- BeanContextServicesListener,- DesignMode,- PropertyChangeListener,- VetoableChangeListener,- Visibility,- Serializable,- Iterable,- Collection,- EventListener
@Deprecated(since="23",
            forRemoval=true)
public class BeanContextServicesSupport
extends BeanContextSupport
implements BeanContextServices
Deprecated, for removal: This API element is subject to removal in a future version.
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.
- Since:
- 1.2
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classDeprecated, for removal: This API element is subject to removal in a future version.A protected nested class containing per-child information in thechildrenhashtable.protected classDeprecated, for removal: This API element is subject to removal in a future version.Subclasses may subclass this nested class to represent a proxy for each BeanContextServiceProvider.protected static classDeprecated, for removal: This API element is subject to removal in a future version.subclasses may subclass this nested class to add behaviors for each BeanContextServicesProvider.Nested classes/interfaces declared in class java.beans.beancontext.BeanContextSupportBeanContextSupport.BCSChild, BeanContextSupport.BCSIterator
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ArrayList<BeanContextServicesListener> Deprecated, for removal: This API element is subject to removal in a future version.List ofBeanContextServicesListenerobjects.Deprecated, for removal: This API element is subject to removal in a future version.Delegate for theBeanContextServiceProvider.protected intDeprecated, for removal: This API element is subject to removal in a future version.The number of instances of a serializableBeanContextServceProvider.Deprecated, for removal: This API element is subject to removal in a future version.all accesses to theprotected transient HashMap servicesfield should be synchronized on that objectFields declared in class java.beans.beancontext.BeanContextSupportbcmListeners, children, designTime, locale, okToUseGuiFields declared in class java.beans.beancontext.BeanContextChildSupportbeanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupportFields declared in interface java.beans.beancontext.BeanContextglobalHierarchyLockFields declared in interface java.beans.DesignModePROPERTYNAME
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Create an instance that is not a delegate of another objectDeprecated, for removal: This API element is subject to removal in a future version.Create an instance with a peerBeanContextServicesSupport(BeanContextServices peer, Locale lcle) Deprecated, for removal: This API element is subject to removal in a future version.Create an instance using the specified localeBeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dtime) Deprecated, for removal: This API element is subject to removal in a future version.Create an instance using the specified Locale and design mode.BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dTime, boolean visible) Deprecated, for removal: This API element is subject to removal in a future version.Construct a BeanContextServicesSupport instance
- 
Method SummaryModifier and TypeMethodDescriptionvoidDeprecated, for removal: This API element is subject to removal in a future version.add a BeanContextServicesListenerbooleanaddService(Class<?> serviceClass, BeanContextServiceProvider bcsp) Deprecated, for removal: This API element is subject to removal in a future version.add a serviceprotected booleanaddService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent) Deprecated, for removal: This API element is subject to removal in a future version.add a serviceprotected voidDeprecated, for removal: This API element is subject to removal in a future version.called from BeanContextSupport readObject before it deserializes the children ...protected voidDeprecated, for removal: This API element is subject to removal in a future version.called from BeanContextSupport writeObject before it serializes the children ...protected voidchildJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc) Deprecated, for removal: This API element is subject to removal in a future version.called from superclass child removal operations after a child has been successfully removed. called with child synchronized.protected BeanContextSupport.BCSChildcreateBCSChild(Object targetChild, Object peer) Deprecated, for removal: This API element is subject to removal in a future version.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.createBCSSServiceProvider(Class<?> sc, BeanContextServiceProvider bcsp) Deprecated, for removal: This API element is subject to removal in a future version.subclasses can override this method to create new subclasses of BCSSServiceProvider without having to override addService() in order to instantiate.protected final voidDeprecated, for removal: This API element is subject to removal in a future version.Fires aBeanContextServiceAvailableEventindicating that a new service has become available.protected final voidfireServiceAdded(Class<?> serviceClass) Deprecated, for removal: This API element is subject to removal in a future version.Fires aBeanContextServiceEventnotifying of a new service.protected final voidDeprecated, for removal: This API element is subject to removal in a future version.Fires aBeanContextServiceEventnotifying of a service being revoked.protected final voidfireServiceRevoked(Class<?> serviceClass, boolean revokeNow) Deprecated, for removal: This API element is subject to removal in a future version.Fires aBeanContextServiceRevokedEventindicating that a particular service is no longer available.Deprecated, for removal: This API element is subject to removal in a future version.Gets theBeanContextServicesassociated with thisBeanContextServicesSupport.protected static final BeanContextServicesListenerDeprecated, for removal: This API element is subject to removal in a future version.Gets theBeanContextServicesListener(if any) of the specified child.Deprecated, for removal: This API element is subject to removal in a future version.Gets the currently available services for this context.Iterator<?> getCurrentServiceSelectors(Class<?> serviceClass) Deprecated, for removal: This API element is subject to removal in a future version.Gets the list of service dependent service parameters (Service Selectors) for the specified service, by calling getCurrentServiceSelectors() on the underlying BeanContextServiceProvider.getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) Deprecated, for removal: This API element is subject to removal in a future version.obtain a service which may be delegatedbooleanhasService(Class<?> serviceClass) Deprecated, for removal: This API element is subject to removal in a future version.has a service, which may be delegatedvoidDeprecated, for removal: This API element is subject to removal in a future version.called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state.protected voidDeprecated, for removal: This API element is subject to removal in a future version.called from setBeanContext to notify a BeanContextChild to allocate resources obtained from the nesting BeanContext.protected voidDeprecated, for removal: This API element is subject to removal in a future version.called from setBeanContext to notify a BeanContextChild to release resources obtained from the nesting BeanContext.voidreleaseService(BeanContextChild child, Object requestor, Object service) Deprecated, for removal: This API element is subject to removal in a future version.release a servicevoidDeprecated, for removal: This API element is subject to removal in a future version.remove a BeanContextServicesListenervoidrevokeService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) Deprecated, for removal: This API element is subject to removal in a future version.remove a servicevoidDeprecated, for removal: This API element is subject to removal in a future version.BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself.voidDeprecated, for removal: This API element is subject to removal in a future version.BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself.Methods declared in class java.beans.beancontext.BeanContextSupportadd, 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, writeChildrenMethods declared in class java.beans.beancontext.BeanContextChildSupportaddPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, isDelegated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, validatePendingSetBeanContextMethods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface java.beans.beancontext.BeanContextaddBeanContextMembershipListener, getResource, getResourceAsStream, instantiateChild, removeBeanContextMembershipListenerMethods declared in interface java.beans.beancontext.BeanContextChildaddPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContextMethods declared in interface java.util.Collectionadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArrayMethods declared in interface java.beans.DesignModeisDesignTime, setDesignTimeMethods declared in interface java.beans.VisibilityavoidingGui, dontUseGui, needsGui, okToUseGui
- 
Field Details- 
servicesDeprecated, for removal: This API element is subject to removal in a future version.all accesses to theprotected transient HashMap servicesfield should be synchronized on that object
- 
serializableprotected transient int serializableDeprecated, for removal: This API element is subject to removal in a future version.The number of instances of a serializableBeanContextServceProvider.
- 
proxyDeprecated, for removal: This API element is subject to removal in a future version.Delegate for theBeanContextServiceProvider.
- 
bcsListenersDeprecated, for removal: This API element is subject to removal in a future version.List ofBeanContextServicesListenerobjects.
 
- 
- 
Constructor Details- 
BeanContextServicesSupportpublic BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dTime, boolean visible) Deprecated, for removal: This API element is subject to removal in a future version.Construct a BeanContextServicesSupport instance - Parameters:
- peer- The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
- lcle- The current Locale for this BeanContext.
- dTime- The initial state, true if in design mode, false if runtime.
- visible- The initial visibility.
 
- 
BeanContextServicesSupportDeprecated, for removal: This API element is subject to removal in a future version.Create an instance using the specified Locale and design mode.- Parameters:
- peer- The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
- lcle- The current Locale for this BeanContext.
- dtime- The initial state, true if in design mode, false if runtime.
 
- 
BeanContextServicesSupportDeprecated, for removal: This API element is subject to removal in a future version.Create an instance using the specified locale- Parameters:
- peer- The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
- lcle- The current Locale for this BeanContext.
 
- 
BeanContextServicesSupportDeprecated, for removal: This API element is subject to removal in a future version.Create an instance with a peer- Parameters:
- peer- The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
 
- 
BeanContextServicesSupportpublic BeanContextServicesSupport()Deprecated, for removal: This API element is subject to removal in a future version.Create an instance that is not a delegate of another object
 
- 
- 
Method Details- 
initializepublic void initialize()Deprecated, for removal: This API element is subject to removal in a future version.called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state. subclasses may envelope this method, but should not override it or call it directly.- Overrides:
- initializein class- BeanContextSupport
 
- 
getBeanContextServicesPeerDeprecated, for removal: This API element is subject to removal in a future version.Gets theBeanContextServicesassociated with thisBeanContextServicesSupport.- Returns:
- the instance of BeanContextthis object is providing the implementation for.
 
- 
createBCSChildDeprecated, for removal: This API element is subject to removal in a future version.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. - Overrides:
- createBCSChildin class- BeanContextSupport
- Parameters:
- targetChild- the child to create the Child on behalf of
- peer- the peer if the targetChild and peer are related by BeanContextProxy
- Returns:
- Subtype-specific subclass of Child without overriding collection methods
 
- 
createBCSSServiceProviderprotected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(Class<?> sc, BeanContextServiceProvider bcsp) Deprecated, for removal: This API element is subject to removal in a future version.subclasses can override this method to create new subclasses of BCSSServiceProvider without having to override addService() in order to instantiate.- Parameters:
- sc- the class
- bcsp- the service provider
- Returns:
- a service provider without overriding addService()
 
- 
addBeanContextServicesListenerDeprecated, for removal: This API element is subject to removal in a future version.add a BeanContextServicesListener- Specified by:
- addBeanContextServicesListenerin interface- BeanContextServices
- Parameters:
- bcsl- the- BeanContextServicesListenerto add
- Throws:
- NullPointerException- if the argument is null
 
- 
removeBeanContextServicesListenerDeprecated, for removal: This API element is subject to removal in a future version.remove a BeanContextServicesListener- Specified by:
- removeBeanContextServicesListenerin interface- BeanContextServices
- Parameters:
- bcsl- the- BeanContextServicesListenerto remove from this context
 
- 
addServiceDeprecated, for removal: This API element is subject to removal in a future version.add a service- Specified by:
- addServicein interface- BeanContextServices
- Parameters:
- serviceClass- the service class
- bcsp- the service provider
- Returns:
- true if the service was successful added, false otherwise
 
- 
addServiceprotected boolean addService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent) Deprecated, for removal: This API element is subject to removal in a future version.add a service- Parameters:
- serviceClass- the service class
- bcsp- the service provider
- fireEvent- whether or not an event should be fired
- Returns:
- true if the service was successfully added
 
- 
revokeServicepublic void revokeService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) Deprecated, for removal: This API element is subject to removal in a future version.remove a service- Specified by:
- revokeServicein interface- BeanContextServices
- Parameters:
- serviceClass- the service class
- bcsp- the service provider
- revokeCurrentServicesNow- whether or not to revoke the service
 
- 
hasServiceDeprecated, for removal: This API element is subject to removal in a future version.has a service, which may be delegated- Specified by:
- hasServicein interface- BeanContextServices
- Parameters:
- serviceClass- the service in question
- Returns:
- true if the service is available
 
- 
getServicepublic Object getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException Deprecated, for removal: This API element is subject to removal in a future version.obtain a service which may be delegated- Specified by:
- getServicein interface- BeanContextServices
- Parameters:
- child- the- BeanContextChildassociated with this request
- requestor- the object requesting the service
- serviceClass- class of the requested service
- serviceSelector- the service dependent parameter
- bcsrl- the- BeanContextServiceRevokedListenerto notify if the service should later become revoked
- Returns:
- a reference to this context's named
 Service as requested or null
- Throws:
- TooManyListenersException- if there are too many listeners
 
- 
releaseServiceDeprecated, for removal: This API element is subject to removal in a future version.release a service- Specified by:
- releaseServicein interface- BeanContextServices
- Parameters:
- child- the- BeanContextChild
- requestor- the requestor
- service- the service
 
- 
getCurrentServiceClassesDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:BeanContextServicesGets the currently available services for this context.- Specified by:
- getCurrentServiceClassesin interface- BeanContextServices
- Returns:
- an iterator for all the currently registered service classes.
 
- 
getCurrentServiceSelectorsDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:BeanContextServicesGets the list of service dependent service parameters (Service Selectors) for the specified service, by calling getCurrentServiceSelectors() on the underlying BeanContextServiceProvider.- Specified by:
- getCurrentServiceSelectorsin interface- BeanContextServices
- Parameters:
- serviceClass- the specified service
- Returns:
- an iterator for all the currently available service selectors (if any) available for the specified service.
 
- 
serviceAvailableDeprecated, for removal: This API element is subject to removal in a future version.BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself. subclasses may override or envelope this method to implement their own propagation semantics.- Specified by:
- serviceAvailablein interface- BeanContextServicesListener
- Overrides:
- serviceAvailablein class- BeanContextChildSupport
- Parameters:
- bcssae- The BeanContextServiceAvailableEvent fired as a result of a service becoming available
 
- 
serviceRevokedDeprecated, for removal: This API element is subject to removal in a future version.BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself. subclasses may override or envelope this method to implement their own propagation semantics.- Specified by:
- serviceRevokedin interface- BeanContextServiceRevokedListener
- Overrides:
- serviceRevokedin class- BeanContextChildSupport
- Parameters:
- bcssre- The- BeanContextServiceRevokedEventfired as a result of a service being revoked
 
- 
getChildBeanContextServicesListenerprotected static final BeanContextServicesListener getChildBeanContextServicesListener(Object child) Deprecated, for removal: This API element is subject to removal in a future version.Gets theBeanContextServicesListener(if any) of the specified child.- Parameters:
- child- the specified child
- Returns:
- the BeanContextServicesListener (if any) of the specified child
 
- 
childJustRemovedHookDeprecated, for removal: This API element is subject to removal in a future version.called from superclass child removal operations after a child has been successfully removed. called with child synchronized. This subclass uses this hook to immediately revoke any services being used by this child if it is a BeanContextChild. subclasses may envelope this method in order to implement their own child removal side-effects.- Overrides:
- childJustRemovedHookin class- BeanContextSupport
- Parameters:
- child- the child
- bcsc- the BCSChild
 
- 
releaseBeanContextResourcesprotected void releaseBeanContextResources()Deprecated, for removal: This API element is subject to removal in a future version.called from setBeanContext to notify a BeanContextChild to release resources obtained from the nesting BeanContext. This method revokes any services obtained from its parent. subclasses may envelope this method to implement their own semantics.- Overrides:
- releaseBeanContextResourcesin class- BeanContextChildSupport
 
- 
initializeBeanContextResourcesprotected void initializeBeanContextResources()Deprecated, for removal: This API element is subject to removal in a future version.called from setBeanContext to notify a BeanContextChild to allocate resources obtained from the nesting BeanContext. subclasses may envelope this method to implement their own semantics.- Overrides:
- initializeBeanContextResourcesin class- BeanContextChildSupport
 
- 
fireServiceAddedDeprecated, for removal: This API element is subject to removal in a future version.Fires aBeanContextServiceEventnotifying of a new service.- Parameters:
- serviceClass- the service class
 
- 
fireServiceAddedDeprecated, for removal: This API element is subject to removal in a future version.Fires aBeanContextServiceAvailableEventindicating that a new service has become available.- Parameters:
- bcssae- the- BeanContextServiceAvailableEvent
 
- 
fireServiceRevokedDeprecated, for removal: This API element is subject to removal in a future version.Fires aBeanContextServiceEventnotifying of a service being revoked.- Parameters:
- bcsre- the- BeanContextServiceRevokedEvent
 
- 
fireServiceRevokedDeprecated, for removal: This API element is subject to removal in a future version.Fires aBeanContextServiceRevokedEventindicating that a particular service is no longer available.- Parameters:
- serviceClass- the service class
- revokeNow- whether or not the event should be revoked now
 
- 
bcsPreSerializationHookDeprecated, for removal: This API element is subject to removal in a future version.called from BeanContextSupport writeObject before it serializes the children ... This class will serialize any Serializable BeanContextServiceProviders herein. subclasses may envelope this method to insert their own serialization processing that has to occur prior to serialization of the children- Overrides:
- bcsPreSerializationHookin class- BeanContextSupport
- Parameters:
- oos- the- ObjectOutputStreamto use during serialization
- Throws:
- IOException- if serialization failed
 
- 
bcsPreDeserializationHookprotected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException Deprecated, for removal: This API element is subject to removal in a future version.called from BeanContextSupport readObject before it deserializes the children ... This class will deserialize any Serializable BeanContextServiceProviders serialized earlier thus making them available to the children when they deserialized. subclasses may envelope this method to insert their own serialization processing that has to occur prior to serialization of the children- Overrides:
- bcsPreDeserializationHookin class- BeanContextSupport
- Parameters:
- ois- the- ObjectInputStreamto use during deserialization
- Throws:
- IOException- if deserialization failed
- ClassNotFoundException- if needed classes are not found
 
 
-