java.lang.Object | |||
↳ | java.beans.beancontext.BeanContextChildSupport | ||
↳ | java.beans.beancontext.BeanContextSupport | ||
↳ | java.beans.beancontext.BeanContextServicesSupport |
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.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BeanContextServicesSupport.BCSSChild | |||||||||||
BeanContextServicesSupport.BCSSProxyServiceProvider | |||||||||||
BeanContextServicesSupport.BCSSServiceProvider | subclasses may subclass this nested class to add behaviors for each BeanContextServicesProvider. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
java.beans.DesignMode
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
bcsListeners | List of BeanContextServicesListener objects. | ||||||||||
proxy | Delegate for the BeanContextServiceProvider. | ||||||||||
serializable | The number of instances of a serializable BeanContextServceProvider. | ||||||||||
services | all accesses to the protected transient HashMap services
field should be synchronized on that object
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.beans.beancontext.BeanContextSupport
| |||||||||||
From class
java.beans.beancontext.BeanContextChildSupport
| |||||||||||
From interface
java.beans.beancontext.BeanContext
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct a BeanContextServicesSupport instance | |||||||||||
Create an instance using the specified Locale and design mode.
| |||||||||||
Create an instance using the specified locale
| |||||||||||
Create an instance with a peer
| |||||||||||
Create an instance that is not a delegate of another object
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
add a BeanContextServicesListener
| |||||||||||
add a service
| |||||||||||
Gets the BeanContextServices associated with this
BeanContextServicesSupport.
| |||||||||||
Gets the currently available services for this context.
| |||||||||||
Gets the list of service dependent service parameters
(Service Selectors) for the specified service, by
calling getCurrentServiceSelectors() on the
underlying BeanContextServiceProvider.
| |||||||||||
obtain a service which may be delegated
| |||||||||||
has a service, which may be delegated
| |||||||||||
called by BeanContextSupport superclass during construction and
deserialization to initialize subclass transient state.
| |||||||||||
release a service
| |||||||||||
remove a BeanContextServicesListener
| |||||||||||
remove a service
| |||||||||||
BeanContextServicesListener callback, propagates event to all
currently registered listeners and BeanContextServices children,
if this BeanContextService does not already implement this service
itself.
| |||||||||||
BeanContextServicesListener callback, propagates event to all
currently registered listeners and BeanContextServices children,
if this BeanContextService does not already implement this service
itself.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
add a service
| |||||||||||
called from BeanContextSupport readObject before it deserializes the
children ...
| |||||||||||
called from BeanContextSupport writeObject before it serializes the
children ...
| |||||||||||
called from superclass child removal operations after a child
has been successfully removed.
| |||||||||||
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. | |||||||||||
subclasses can override this method to create new subclasses of
BCSSServiceProvider without having to overrride addService() in
order to instantiate.
| |||||||||||
Fires a BeanContextServiceEvent notifying of a new service.
| |||||||||||
Fires a BeanContextServiceAvailableEvent indicating that a new
service has become available.
| |||||||||||
Fires a BeanContextServiceRevokedEvent
indicating that a particular service is
no longer available.
| |||||||||||
Fires a BeanContextServiceEvent notifying of a service being revoked.
| |||||||||||
Gets the BeanContextServicesListener (if any) of the specified
child.
| |||||||||||
called from setBeanContext to notify a BeanContextChild
to allocate resources obtained from the nesting BeanContext.
| |||||||||||
called from setBeanContext to notify a BeanContextChild
to release resources obtained from the nesting BeanContext.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.beans.beancontext.BeanContextSupport
| |||||||||||
From class
java.beans.beancontext.BeanContextChildSupport
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.beans.DesignMode
| |||||||||||
From interface
java.beans.PropertyChangeListener
| |||||||||||
From interface
java.beans.VetoableChangeListener
| |||||||||||
From interface
java.beans.Visibility
| |||||||||||
From interface
java.beans.beancontext.BeanContext
| |||||||||||
From interface
java.beans.beancontext.BeanContextChild
| |||||||||||
From interface
java.beans.beancontext.BeanContextServiceRevokedListener
| |||||||||||
From interface
java.beans.beancontext.BeanContextServices
| |||||||||||
From interface
java.beans.beancontext.BeanContextServicesListener
| |||||||||||
From interface
java.lang.Iterable
| |||||||||||
From interface
java.util.Collection
|
Delegate for the BeanContextServiceProvider.
The number of instances of a serializable BeanContextServceProvider.
all accesses to the protected transient HashMap services
field should be synchronized on that object
Construct a BeanContextServicesSupport instance
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. |
Create an instance using the specified Locale and design mode.
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. |
Create an instance using the specified locale
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. |
Create an instance with a peer
peer | The peer BeanContext we are supplying an implementation for, if null the this object is its own peer |
---|
Create an instance that is not a delegate of another object
add a BeanContextServicesListener
bcsl | the BeanContextServicesListener to add
|
---|
NullPointerException |
---|
add a service
serviceClass | the service to add |
---|---|
bcsp | the BeanContextServiceProvider
associated with the service
|
Gets the BeanContextServices associated with this BeanContextServicesSupport.
Gets the currently available services for this context.
Gets the list of service dependent service parameters (Service Selectors) for the specified service, by calling getCurrentServiceSelectors() on the underlying BeanContextServiceProvider.
serviceClass | the specified service |
---|
obtain a service which may be delegated
child | the BeanContextChild
associated with this request |
---|---|
requestor | the object requesting the service |
serviceClass | class of the requested service |
serviceSelector | the service dependent parameter |
bcsrl | the
BeanContextServiceRevokedListener to notify
if the service should later become revoked |
null
TooManyListenersException |
---|
has a service, which may be delegated
serviceClass | the service in question |
---|
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.
release a service
child | the BeanContextChild |
---|---|
requestor | the requestor |
service | the service |
remove a BeanContextServicesListener
bcsl | the BeanContextServicesListener
to remove from this context
|
---|
remove a service
serviceClass | the service to revoke from this BeanContextServices |
---|---|
bcsp | the BeanContextServiceProvider associated with this particular service that is being revoked |
revokeCurrentServicesNow | a value of true
indicates an exceptional circumstance where the
BeanContextServiceProvider or
BeanContextServices wishes to immediately
terminate service to all currently outstanding references
to the specified service.
|
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.
bcssae | The BeanContextServiceAvailableEvent fired as a result of a service becoming available |
---|
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.
bcssre | The BeanContextServiceRevokedEvent fired as a
result of a service being revoked
|
---|
add a service
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
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
IOException |
---|
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.
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.
targetChild | the child to create the Child on behalf of |
---|---|
peer | the peer if the targetChild and peer are related by BeanContextProxy |
subclasses can override this method to create new subclasses of BCSSServiceProvider without having to overrride addService() in order to instantiate.
Fires a BeanContextServiceEvent notifying of a new service.
Fires a BeanContextServiceAvailableEvent indicating that a new service has become available.
bcssae | the BeanContextServiceAvailableEvent |
---|
Fires a BeanContextServiceRevokedEvent indicating that a particular service is no longer available.
Fires a BeanContextServiceEvent notifying of a service being revoked.
bcsre | the BeanContextServiceRevokedEvent |
---|
Gets the BeanContextServicesListener (if any) of the specified child.
child | the specified child |
---|
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.
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.