Class 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
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 Summary
| Modifier and Type | Class | Description |
|---|---|---|
protected class |
BeanContextServicesSupport.BCSSChild |
Deprecated, for removal: This API element is subject to removal in a future version. A protected nested class containing per-child information in the children hashtable. |
protected class |
BeanContextServicesSupport.BCSSProxyServiceProvider |
Deprecated, 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 class |
BeanContextServicesSupport.BCSSServiceProvider |
Deprecated, 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 BeanContextSupport
BeanContextSupport.BCSChild, BeanContextSupport.BCSIterator | Modifier and Type | Class | Description |
|---|---|---|
protected class |
BeanContextSupport.BCSChild |
Deprecated, for removal: This API element is subject to removal in a future version. A protected nested class containing per-child information in the children hashtable. |
protected static final class |
BeanContextSupport.BCSIterator |
Deprecated, for removal: This API element is subject to removal in a future version. protected final subclass that encapsulates an iterator but implements a noop remove() method. |
Field Summary
| Modifier and Type | Field | Description |
|---|---|---|
protected ArrayList |
bcsListeners |
Deprecated, for removal: This API element is subject to removal in a future version. List of BeanContextServicesListener objects. |
protected BeanContextServicesSupport.BCSSProxyServiceProvider |
proxy |
Deprecated, for removal: This API element is subject to removal in a future version. Delegate for the BeanContextServiceProvider. |
protected int |
serializable |
Deprecated, for removal: This API element is subject to removal in a future version. The number of instances of a serializable BeanContextServceProvider. |
protected HashMap |
services |
Deprecated, for removal: This API element is subject to removal in a future version. all accesses to the protected transient HashMap services field should be synchronized on that object |
Fields declared in class BeanContextSupport
bcmListeners, children, designTime, locale, okToUseGui | Modifier and Type | Field | Description |
|---|---|---|
protected ArrayList |
bcmListeners |
Deprecated, for removal: This API element is subject to removal in a future version. all accesses to the protected ArrayList bcmListeners field shall be synchronized on that object. |
protected HashMap |
children |
Deprecated, for removal: This API element is subject to removal in a future version. all accesses to the protected HashMap children field shall be synchronized on that object. |
protected boolean |
designTime |
Deprecated, for removal: This API element is subject to removal in a future version. A boolean indicating whether or not this object is currently in design time mode. |
protected Locale |
locale |
Deprecated, for removal: This API element is subject to removal in a future version. The current locale of this BeanContext. |
protected boolean |
okToUseGui |
Deprecated, for removal: This API element is subject to removal in a future version. A boolean indicating if this instance may now render a GUI. |
Fields declared in class BeanContextChildSupport
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport | Modifier and Type | Field | Description |
|---|---|---|
protected BeanContext |
beanContext |
Deprecated, for removal: This API element is subject to removal in a future version. The bean context. |
BeanContextChild |
beanContextChildPeer |
Deprecated, for removal: This API element is subject to removal in a future version. The BeanContext in which this BeanContextChild is nested. |
protected PropertyChangeSupport |
pcSupport |
Deprecated, for removal: This API element is subject to removal in a future version. The PropertyChangeSupport associated with this BeanContextChildSupport. |
protected boolean |
rejectedSetBCOnce |
Deprecated, for removal: This API element is subject to removal in a future version. A flag indicating that there has been at least one PropertyChangeVetoException thrown for the attempted setBeanContext operation. |
protected VetoableChangeSupport |
vcSupport |
Deprecated, for removal: This API element is subject to removal in a future version. The VetoableChangeSupport associated with this BeanContextChildSupport. |
Fields declared in interface BeanContext
globalHierarchyLock | Modifier and Type | Field | Description |
|---|---|---|
static final Object |
globalHierarchyLock |
Deprecated, for removal: This API element is subject to removal in a future version. This global lock is used by both BeanContext and BeanContextServices implementors to serialize changes in a BeanContext hierarchy and any service requests etc. |
Fields declared in interface DesignMode
PROPERTYNAME | Modifier and Type | Field | Description |
|---|---|---|
static final String |
PROPERTYNAME |
The standard value of the propertyName as fired from a BeanContext or other source of PropertyChangeEvents. |
Constructor Summary
| Constructor | Description |
|---|---|
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 |
BeanContextServicesSupport |
Deprecated, for removal: This API element is subject to removal in a future version. Create an instance with a peer |
BeanContextServicesSupport |
Deprecated, for removal: This API element is subject to removal in a future version. Create an instance using the specified locale |
BeanContextServicesSupport |
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 |
Deprecated, for removal: This API element is subject to removal in a future version. Construct a BeanContextServicesSupport instance |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
void |
addBeanContextServicesListener |
Deprecated, for removal: This API element is subject to removal in a future version. add a BeanContextServicesListener |
boolean |
addService |
Deprecated, for removal: This API element is subject to removal in a future version. add a service |
protected boolean |
addService |
Deprecated, for removal: This API element is subject to removal in a future version. add a service |
protected void |
bcsPreDeserializationHook |
Deprecated, for removal: This API element is subject to removal in a future version. called from BeanContextSupport readObject before it deserializes the children ... |
protected void |
bcsPreSerializationHook |
Deprecated, for removal: This API element is subject to removal in a future version. called from BeanContextSupport writeObject before it serializes the children ... |
protected void |
childJustRemovedHook |
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.BCSChild |
createBCSChild |
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. |
protected BeanContextServicesSupport.BCSSServiceProvider |
createBCSSServiceProvider |
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 void |
fireServiceAdded |
Deprecated, for removal: This API element is subject to removal in a future version. Fires a BeanContextServiceAvailableEvent indicating that a new service has become available. |
protected final void |
fireServiceAdded |
Deprecated, for removal: This API element is subject to removal in a future version. Fires a BeanContextServiceEvent notifying of a new service. |
protected final void |
fireServiceRevoked |
Deprecated, for removal: This API element is subject to removal in a future version. Fires a BeanContextServiceEvent notifying of a service being revoked. |
protected final void |
fireServiceRevoked |
Deprecated, for removal: This API element is subject to removal in a future version. Fires a BeanContextServiceRevokedEvent indicating that a particular service is no longer available. |
BeanContextServices |
getBeanContextServicesPeer() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the BeanContextServices associated with this BeanContextServicesSupport. |
protected static final BeanContextServicesListener |
getChildBeanContextServicesListener |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the BeanContextServicesListener (if any) of the specified child. |
Iterator |
getCurrentServiceClasses() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the currently available services for this context. |
Iterator |
getCurrentServiceSelectors |
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. |
Object |
getService |
Deprecated, for removal: This API element is subject to removal in a future version. obtain a service which may be delegated |
boolean |
hasService |
Deprecated, for removal: This API element is subject to removal in a future version. has a service, which may be delegated |
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. |
protected 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. |
protected 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. |
void |
releaseService |
Deprecated, for removal: This API element is subject to removal in a future version. release a service |
void |
removeBeanContextServicesListener |
Deprecated, for removal: This API element is subject to removal in a future version. remove a BeanContextServicesListener |
void |
revokeService |
Deprecated, for removal: This API element is subject to removal in a future version. remove a service |
void |
serviceAvailable |
Deprecated, 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. |
void |
serviceRevoked |
Deprecated, 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 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 | Modifier and Type | Method | Description |
|---|---|---|
boolean |
add |
Deprecated, for removal: This API element is subject to removal in a future version. Adds/nests a child within this BeanContext. |
boolean |
addAll |
Deprecated, for removal: This API element is subject to removal in a future version. add Collection to set of Children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field |
void |
addBeanContextMembershipListener |
Deprecated, for removal: This API element is subject to removal in a future version. Adds a BeanContextMembershipListener |
boolean |
avoidingGui() |
Deprecated, for removal: This API element is subject to removal in a future version. Used to determine if the BeanContext child is avoiding using its GUI. |
protected Iterator |
bcsChildren() |
Deprecated, for removal: This API element is subject to removal in a future version. Returns an iterator of all children of this BeanContext. |
protected void |
childDeserializedHook |
Deprecated, for removal: This API element is subject to removal in a future version. Called by readObject with the newly deserialized child and BCSChild. |
protected void |
childJustAddedHook |
Deprecated, for removal: This API element is subject to removal in a future version. subclasses may override this method to simply extend add() semantics after the child has been added and before the event notification has occurred. |
protected static final boolean |
classEquals |
Deprecated, for removal: This API element is subject to removal in a future version. Tests to see if two class objects, or their names are equal. |
void |
clear() |
Deprecated, for removal: This API element is subject to removal in a future version. clear the children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field |
boolean |
contains |
Deprecated, for removal: This API element is subject to removal in a future version. Determines whether or not the specified object is currently a child of this BeanContext. |
boolean |
containsAll |
Deprecated, for removal: This API element is subject to removal in a future version. Tests to see if all objects in the specified Collection are children of this BeanContext. |
boolean |
containsKey |
Deprecated, for removal: This API element is subject to removal in a future version. Determines whether or not the specified object is currently a child of this BeanContext. |
protected final Object[] |
copyChildren() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets a copy of the this BeanContext's children. |
protected final void |
deserialize |
Deprecated, for removal: This API element is subject to removal in a future version. used by readObject to deserialize a collection. |
void |
dontUseGui() |
Deprecated, for removal: This API element is subject to removal in a future version. notify this instance that it may no longer render a GUI. |
protected final void |
fireChildrenAdded |
Deprecated, for removal: This API element is subject to removal in a future version. Fire a BeanContextMembershipEvent on the BeanContextMembershipListener interface |
protected final void |
fireChildrenRemoved |
Deprecated, for removal: This API element is subject to removal in a future version. Fire a BeanContextMembershipEvent on the BeanContextMembershipListener interface |
BeanContext |
getBeanContextPeer() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the instance of BeanContext that this object is providing the implementation for. |
protected static final BeanContextChild |
getChildBeanContextChild |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the BeanContextChild (if any) of the specified child |
protected static final BeanContextMembershipListener |
getChildBeanContextMembershipListener |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the BeanContextMembershipListener (if any) of the specified child |
protected static final PropertyChangeListener |
getChildPropertyChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the PropertyChangeListener (if any) of the specified child |
protected static final Serializable |
getChildSerializable |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the Serializable (if any) associated with the specified Child |
protected static final VetoableChangeListener |
getChildVetoableChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the VetoableChangeListener (if any) of the specified child |
protected static final Visibility |
getChildVisibility |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the Component (if any) associated with the specified child. |
Locale |
getLocale() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the locale for this BeanContext. |
URL |
getResource |
Deprecated, for removal: This API element is subject to removal in a future version. Analogous to java.lang.ClassLoader.getResource(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader. |
InputStream |
getResourceAsStream |
Deprecated, for removal: This API element is subject to removal in a future version. Analogous to java.lang.ClassLoader.getResourceAsStream(), this method allows a BeanContext implementation to interpose behavior between the child Component and underlying ClassLoader. |
Object |
instantiateChild |
Deprecated, for removal: This API element is subject to removal in a future version. The instantiateChild method is a convenience hook in BeanContext to simplify the task of instantiating a Bean, nested, into a BeanContext. |
boolean |
isDesignTime() |
Deprecated, for removal: This API element is subject to removal in a future version. Reports whether or not this object is in currently in design time mode. |
boolean |
isEmpty() |
Deprecated, for removal: This API element is subject to removal in a future version. Reports whether or not this BeanContext is empty. |
boolean |
isSerializing() |
Deprecated, for removal: This API element is subject to removal in a future version. Is this BeanContext in the process of being serialized? |
Iterator |
iterator() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets all JavaBean or BeanContext instances currently nested in this BeanContext. |
boolean |
needsGui() |
Deprecated, for removal: This API element is subject to removal in a future version. This method is typically called from the environment in order to determine if the implementor "needs" a GUI. |
void |
okToUseGui() |
Deprecated, for removal: This API element is subject to removal in a future version. Notify this instance that it may now render a GUI |
void |
propertyChange |
Deprecated, for removal: This API element is subject to removal in a future version. subclasses may envelope to monitor child property changes. |
final void |
readChildren |
Deprecated, for removal: This API element is subject to removal in a future version. When an instance of this class is used as a delegate for the implementation of the BeanContext protocols (and its subprotocols) there exists a 'chicken and egg' problem during deserialization |
boolean |
remove |
Deprecated, for removal: This API element is subject to removal in a future version. Removes a child from this BeanContext. |
protected boolean |
remove |
Deprecated, for removal: This API element is subject to removal in a future version. internal remove used when removal caused by unexpected setBeanContext or by remove() invocation. |
boolean |
removeAll |
Deprecated, for removal: This API element is subject to removal in a future version. remove all specified children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field |
void |
removeBeanContextMembershipListener |
Deprecated, for removal: This API element is subject to removal in a future version. Removes a BeanContextMembershipListener |
boolean |
retainAll |
Deprecated, for removal: This API element is subject to removal in a future version. retain only specified children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field |
protected final void |
serialize |
Deprecated, for removal: This API element is subject to removal in a future version. Used by writeObject to serialize a Collection. |
void |
setDesignTime |
Deprecated, for removal: This API element is subject to removal in a future version. Sets the new design time value for this BeanContext. |
void |
setLocale |
Deprecated, for removal: This API element is subject to removal in a future version. Sets the locale of this BeanContext. |
int |
size() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the number of children currently nested in this BeanContext. |
Object[] |
toArray() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets all JavaBean or BeanContext instances currently nested in this BeanContext. |
Object[] |
toArray |
Deprecated, for removal: This API element is subject to removal in a future version. Gets an array containing all children of this BeanContext that match the types contained in arry. |
protected boolean |
validatePendingAdd |
Deprecated, for removal: This API element is subject to removal in a future version. Subclasses of this class may override, or envelope, this method to add validation behavior for the BeanContext to examine child objects immediately prior to their being added to the BeanContext. |
protected boolean |
validatePendingRemove |
Deprecated, for removal: This API element is subject to removal in a future version. Subclasses of this class may override, or envelope, this method to add validation behavior for the BeanContext to examine child objects immediately prior to their being removed from the BeanContext. |
void |
vetoableChange |
Deprecated, for removal: This API element is subject to removal in a future version. subclasses may envelope to monitor veto child property changes. |
final void |
writeChildren |
Deprecated, for removal: This API element is subject to removal in a future version. Used to serialize all children of this BeanContext. |
Methods declared in class BeanContextChildSupport
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, isDelegated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, validatePendingSetBeanContext | Modifier and Type | Method | Description |
|---|---|---|
void |
addPropertyChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Add a PropertyChangeListener for a specific property. |
void |
addVetoableChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Add a VetoableChangeListener for a specific property. |
void |
firePropertyChange |
Deprecated, for removal: This API element is subject to removal in a future version. Report a bound property update to any registered listeners. |
void |
fireVetoableChange |
Deprecated, for removal: This API element is subject to removal in a future version. Report a vetoable property update to any registered listeners. |
BeanContext |
getBeanContext() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the nesting BeanContext for this BeanContextChildSupport. |
BeanContextChild |
getBeanContextChildPeer() |
Deprecated, for removal: This API element is subject to removal in a future version. Gets the BeanContextChild associated with this BeanContextChildSupport. |
boolean |
isDelegated() |
Deprecated, for removal: This API element is subject to removal in a future version. Reports whether or not this class is a delegate of another. |
void |
removePropertyChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Remove a PropertyChangeListener for a specific property. |
void |
removeVetoableChangeListener |
Deprecated, for removal: This API element is subject to removal in a future version. Removes a VetoableChangeListener. |
void |
setBeanContext |
Deprecated, for removal: This API element is subject to removal in a future version. Sets the BeanContext for this BeanContextChildSupport. |
boolean |
validatePendingSetBeanContext |
Deprecated, for removal: This API element is subject to removal in a future version. Called from setBeanContext to validate (or otherwise) the pending change in the nesting BeanContext property value. |
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
protected Object |
clone() |
Creates and returns a copy of this object. |
boolean |
equals |
Indicates whether some other object is "equal to" this one. |
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
int |
hashCode() |
Returns a hash code value for this object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
String |
toString() |
Returns a string representation of the object. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Methods declared in interface Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray | Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals |
Compares the specified object with this collection for equality. |
int |
hashCode() |
Returns the hash code value for this collection. |
default Stream |
parallelStream() |
Returns a possibly parallel Stream with this collection as its source. |
default boolean |
removeIf |
Removes all of the elements of this collection that satisfy the given predicate (optional operation). |
default Spliterator |
spliterator() |
Creates a Spliterator over the elements in this collection. |
default Stream |
stream() |
Returns a sequential Stream with this collection as its source. |
default <T> Object[] |
toArray |
Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array. |
Field Details
services
protected transient HashMap<Object, BeanContextServicesSupport.BCSSServiceProvider> services
protected transient HashMap services field should be synchronized on that objectserializable
protected transient int serializable
BeanContextServceProvider.proxy
protected transient BeanContextServicesSupport.BCSSProxyServiceProvider proxy
BeanContextServiceProvider.bcsListeners
protected transient ArrayList<BeanContextServicesListener> bcsListeners
BeanContextServicesListener objects.Constructor Details
BeanContextServicesSupport
public BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dTime, boolean visible)
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.
BeanContextServicesSupport
public BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dtime)
- 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.
BeanContextServicesSupport
public BeanContextServicesSupport(BeanContextServices peer, Locale lcle)
- 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.
BeanContextServicesSupport
public BeanContextServicesSupport(BeanContextServices peer)
- Parameters:
-
peer- The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
BeanContextServicesSupport
public BeanContextServicesSupport()
Method Details
initialize
public void initialize()
- Overrides:
-
initializein classBeanContextSupport
getBeanContextServicesPeer
public BeanContextServices getBeanContextServicesPeer()
BeanContextServices associated with this BeanContextServicesSupport.- Returns:
- the instance of
BeanContextthis object is providing the implementation for.
createBCSChild
protected BeanContextSupport.BCSChild createBCSChild(Object targetChild, Object peer)
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 classBeanContextSupport - 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
createBCSSServiceProvider
protected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(Class<?> sc, BeanContextServiceProvider bcsp)
- Parameters:
-
sc- the class -
bcsp- the service provider - Returns:
- a service provider without overriding addService()
addBeanContextServicesListener
public void addBeanContextServicesListener(BeanContextServicesListener bcsl)
- Specified by:
-
addBeanContextServicesListenerin interfaceBeanContextServices - Parameters:
-
bcsl- theBeanContextServicesListenerto add - Throws:
-
NullPointerException- if the argument is null
removeBeanContextServicesListener
public void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
- Specified by:
-
removeBeanContextServicesListenerin interfaceBeanContextServices - Parameters:
-
bcsl- theBeanContextServicesListenerto remove from this context
addService
public boolean addService(Class<?> serviceClass, BeanContextServiceProvider bcsp)
- Specified by:
-
addServicein interfaceBeanContextServices - Parameters:
-
serviceClass- the service class -
bcsp- the service provider - Returns:
- true if the service was successful added, false otherwise
addService
protected boolean addService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)
- 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
revokeService
public void revokeService(Class<?> serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow)
- Specified by:
-
revokeServicein interfaceBeanContextServices - Parameters:
-
serviceClass- the service class -
bcsp- the service provider -
revokeCurrentServicesNow- whether or not to revoke the service
hasService
public boolean hasService(Class<?> serviceClass)
- Specified by:
-
hasServicein interfaceBeanContextServices - Parameters:
-
serviceClass- the service in question - Returns:
- true if the service is available
getService
public Object getService(BeanContextChild child, Object requestor, Class<?> serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException
- Specified by:
-
getServicein interfaceBeanContextServices - Parameters:
-
child- theBeanContextChildassociated with this request -
requestor- the object requesting the service -
serviceClass- class of the requested service -
serviceSelector- the service dependent parameter -
bcsrl- theBeanContextServiceRevokedListenerto 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
releaseService
public void releaseService(BeanContextChild child, Object requestor, Object service)
- Specified by:
-
releaseServicein interfaceBeanContextServices - Parameters:
-
child- theBeanContextChild -
requestor- the requestor -
service- the service
getCurrentServiceClasses
public Iterator<Object> getCurrentServiceClasses()
BeanContextServices- Specified by:
-
getCurrentServiceClassesin interfaceBeanContextServices - Returns:
- an iterator for all the currently registered service classes.
getCurrentServiceSelectors
public Iterator<?> getCurrentServiceSelectors(Class<?> serviceClass)
BeanContextServices- Specified by:
-
getCurrentServiceSelectorsin interfaceBeanContextServices - Parameters:
-
serviceClass- the specified service - Returns:
- an iterator for all the currently available service selectors (if any) available for the specified service.
serviceAvailable
public void serviceAvailable(BeanContextServiceAvailableEvent bcssae)
- Specified by:
-
serviceAvailablein interfaceBeanContextServicesListener - Overrides:
-
serviceAvailablein classBeanContextChildSupport - Parameters:
-
bcssae- The BeanContextServiceAvailableEvent fired as a result of a service becoming available
serviceRevoked
public void serviceRevoked(BeanContextServiceRevokedEvent bcssre)
- Specified by:
-
serviceRevokedin interfaceBeanContextServiceRevokedListener - Overrides:
-
serviceRevokedin classBeanContextChildSupport - Parameters:
-
bcssre- TheBeanContextServiceRevokedEventfired as a result of a service being revoked
getChildBeanContextServicesListener
protected static final BeanContextServicesListener getChildBeanContextServicesListener(Object child)
BeanContextServicesListener (if any) of the specified child.- Parameters:
-
child- the specified child - Returns:
- the BeanContextServicesListener (if any) of the specified child
childJustRemovedHook
protected void childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
- Overrides:
-
childJustRemovedHookin classBeanContextSupport - Parameters:
-
child- the child -
bcsc- the BCSChild
releaseBeanContextResources
protected void releaseBeanContextResources()
- Overrides:
-
releaseBeanContextResourcesin classBeanContextChildSupport
initializeBeanContextResources
protected void initializeBeanContextResources()
- Overrides:
-
initializeBeanContextResourcesin classBeanContextChildSupport
fireServiceAdded
protected final void fireServiceAdded(Class<?> serviceClass)
BeanContextServiceEvent notifying of a new service.- Parameters:
-
serviceClass- the service class
fireServiceAdded
protected final void fireServiceAdded(BeanContextServiceAvailableEvent bcssae)
BeanContextServiceAvailableEvent indicating that a new service has become available.- Parameters:
-
bcssae- theBeanContextServiceAvailableEvent
fireServiceRevoked
protected final void fireServiceRevoked(BeanContextServiceRevokedEvent bcsre)
BeanContextServiceEvent notifying of a service being revoked.- Parameters:
-
bcsre- theBeanContextServiceRevokedEvent
fireServiceRevoked
protected final void fireServiceRevoked(Class<?> serviceClass, boolean revokeNow)
BeanContextServiceRevokedEvent indicating that a particular service is no longer available.- Parameters:
-
serviceClass- the service class -
revokeNow- whether or not the event should be revoked now
bcsPreSerializationHook
protected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException
- Overrides:
-
bcsPreSerializationHookin classBeanContextSupport - Parameters:
-
oos- theObjectOutputStreamto use during serialization - Throws:
-
IOException- if serialization failed
bcsPreDeserializationHook
protected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException
- Overrides:
-
bcsPreDeserializationHookin classBeanContextSupport - Parameters:
-
ois- theObjectInputStreamto use during deserialization - Throws:
-
IOException- if deserialization failed -
ClassNotFoundException- if needed classes are not found
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.