Home » openjdk-7 » java » beans » beancontext » [javadoc | source]
java.beans.beancontext
public class: BeanContextServicesSupport [javadoc | source]
java.lang.Object
   java.beans.beancontext.BeanContextChildSupport
      java.beans.beancontext.BeanContextSupport
         java.beans.beancontext.BeanContextServicesSupport

All Implemented Interfaces:
    BeanContextServices, VetoableChangeListener, Serializable, PropertyChangeListener, BeanContext, BeanContextChild, BeanContextServicesListener

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 Class Summary:
protected class  BeanContextServicesSupport.BCSSChild   
protected static class  BeanContextServicesSupport.BCSSServiceProvider  subclasses may subclass this nested class to add behaviors for each BeanContextServicesProvider. 
protected class  BeanContextServicesSupport.BCSSProxyServiceProvider   
Field Summary
protected transient  HashMap services    all accesses to the protected transient HashMap services field should be synchronized on that object 
protected transient  int serializable    The number of instances of a serializable BeanContextServceProvider
protected transient  BCSSProxyServiceProvider proxy    Delegate for the BeanContextServiceProvider
protected transient  ArrayList bcsListeners    List of BeanContextServicesListener objects. 
Fields inherited from java.beans.beancontext.BeanContextSupport:
serialVersionUID,  children,  bcmListeners,  locale,  okToUseGui,  designTime
Fields inherited from java.beans.beancontext.BeanContextChildSupport:
serialVersionUID,  beanContextChildPeer,  pcSupport,  vcSupport,  beanContext,  rejectedSetBCOnce
Constructor:
 public BeanContextServicesSupport() 
 public BeanContextServicesSupport(BeanContextServices peer) 
    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
 public BeanContextServicesSupport(BeanContextServices peer,
    Locale lcle) 
    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.
 public BeanContextServicesSupport(BeanContextServices peer,
    Locale lcle,
    boolean dtime) 
    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.
 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.
Method from java.beans.beancontext.BeanContextServicesSupport Summary:
addBeanContextServicesListener,   addService,   addService,   bcsPreDeserializationHook,   bcsPreSerializationHook,   childJustRemovedHook,   createBCSChild,   createBCSSServiceProvider,   fireServiceAdded,   fireServiceAdded,   fireServiceRevoked,   fireServiceRevoked,   getBeanContextServicesPeer,   getChildBeanContextServicesListener,   getCurrentServiceClasses,   getCurrentServiceSelectors,   getService,   hasService,   initialize,   initializeBeanContextResources,   releaseBeanContextResources,   releaseService,   removeBeanContextServicesListener,   revokeService,   serviceAvailable,   serviceRevoked
Methods from java.beans.beancontext.BeanContextSupport:
add,   addAll,   addBeanContextMembershipListener,   avoidingGui,   bcsChildren,   bcsPreDeserializationHook,   bcsPreSerializationHook,   childDeserializedHook,   childJustAddedHook,   childJustRemovedHook,   classEquals,   clear,   contains,   containsAll,   containsKey,   copyChildren,   createBCSChild,   deserialize,   dontUseGui,   fireChildrenAdded,   fireChildrenRemoved,   getBeanContextPeer,   getChildBeanContextChild,   getChildBeanContextMembershipListener,   getChildPropertyChangeListener,   getChildSerializable,   getChildVetoableChangeListener,   getChildVisibility,   getLocale,   getResource,   getResourceAsStream,   initialize,   instantiateChild,   isDesignTime,   isEmpty,   isSerializing,   iterator,   needsGui,   okToUseGui,   propertyChange,   readChildren,   remove,   remove,   removeAll,   removeBeanContextMembershipListener,   retainAll,   serialize,   setDesignTime,   setLocale,   size,   toArray,   toArray,   validatePendingAdd,   validatePendingRemove,   vetoableChange,   writeChildren
Methods from java.beans.beancontext.BeanContextChildSupport:
addPropertyChangeListener,   addVetoableChangeListener,   firePropertyChange,   fireVetoableChange,   getBeanContext,   getBeanContextChildPeer,   initializeBeanContextResources,   isDelegated,   releaseBeanContextResources,   removePropertyChangeListener,   removeVetoableChangeListener,   serviceAvailable,   serviceRevoked,   setBeanContext,   validatePendingSetBeanContext
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.beans.beancontext.BeanContextServicesSupport Detail:
 public  void addBeanContextServicesListener(BeanContextServicesListener bcsl) 
    add a BeanContextServicesListener
 public boolean addService(Class serviceClass,
    BeanContextServiceProvider bcsp) 
    add a service
 protected boolean addService(Class serviceClass,
    BeanContextServiceProvider bcsp,
    boolean fireEvent) 
    add a service
 protected synchronized  void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException 
    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
 protected synchronized  void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException 
    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
 protected  void childJustRemovedHook(Object child,
    BCSChild bcsc) 
    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.
 protected 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.

 protected BCSSServiceProvider createBCSSServiceProvider(Class sc,
    BeanContextServiceProvider bcsp) 
    subclasses can override this method to create new subclasses of BCSSServiceProvider without having to overrride addService() in order to instantiate.
 protected final  void fireServiceAdded(Class serviceClass) 
    Fires a BeanContextServiceEvent notifying of a new service.
 protected final  void fireServiceAdded(BeanContextServiceAvailableEvent bcssae) 
    Fires a BeanContextServiceAvailableEvent indicating that a new service has become available.
 protected final  void fireServiceRevoked(BeanContextServiceRevokedEvent bcsre) 
    Fires a BeanContextServiceEvent notifying of a service being revoked.
 protected final  void fireServiceRevoked(Class serviceClass,
    boolean revokeNow) 
    Fires a BeanContextServiceRevokedEvent indicating that a particular service is no longer available.
 public BeanContextServices getBeanContextServicesPeer() 
    Gets the BeanContextServices associated with this BeanContextServicesSupport.
 protected static final BeanContextServicesListener getChildBeanContextServicesListener(Object child) 
    Gets the BeanContextServicesListener (if any) of the specified child.
 public Iterator getCurrentServiceClasses() 
 public Iterator getCurrentServiceSelectors(Class serviceClass) 
 public Object getService(BeanContextChild child,
    Object requestor,
    Class serviceClass,
    Object serviceSelector,
    BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException 
    obtain a service which may be delegated
 public synchronized boolean hasService(Class serviceClass) 
    has a service, which may be delegated
 public  void initialize() 
    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.
 protected synchronized  void initializeBeanContextResources() 
    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.
 protected synchronized  void releaseBeanContextResources() 
    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.
 public  void releaseService(BeanContextChild child,
    Object requestor,
    Object service) 
    release a service
 public  void removeBeanContextServicesListener(BeanContextServicesListener bcsl) 
    remove a BeanContextServicesListener
 public  void revokeService(Class serviceClass,
    BeanContextServiceProvider bcsp,
    boolean revokeCurrentServicesNow) 
    remove a service
 public  void serviceAvailable(BeanContextServiceAvailableEvent bcssae) 
    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.
 public  void serviceRevoked(BeanContextServiceRevokedEvent bcssre) 
    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.