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

All Implemented Interfaces:
    BeanContextChild, Serializable, BeanContextServicesListener

Direct Known Subclasses:
    BeanContextServicesSupport, BeanContextSupport

This is a general support class to provide support for implementing the BeanContextChild protocol. This class may either be directly subclassed, or encapsulated and delegated to in order to implement this interface for a given component.

Field Summary
static final  long serialVersionUID     
public  BeanContextChild beanContextChildPeer    The BeanContext in which this BeanContextChild is nested. 
protected  PropertyChangeSupport pcSupport    The PropertyChangeSupport associated with this BeanContextChildSupport
protected  VetoableChangeSupport vcSupport    The VetoableChangeSupport associated with this BeanContextChildSupport
protected transient  BeanContext beanContext     
protected transient  boolean rejectedSetBCOnce    A flag indicating that there has been at least one PropertyChangeVetoException thrown for the attempted setBeanContext operation. 
Constructor:
 public BeanContextChildSupport() 
 public BeanContextChildSupport(BeanContextChild bcc) 
    construct a BeanContextChildSupport where the JavaBean component itself implements BeanContextChild, and encapsulates this, delegating that interface to this implementation
Method from java.beans.beancontext.BeanContextChildSupport Summary:
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.BeanContextChildSupport Detail:
 public  void addPropertyChangeListener(String name,
    PropertyChangeListener pcl) 
    Add a PropertyChangeListener for a specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property. If name or pcl is null, no exception is thrown and no action is taken.
 public  void addVetoableChangeListener(String name,
    VetoableChangeListener vcl) 
    Add a VetoableChangeListener for a specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property. If name or vcl is null, no exception is thrown and no action is taken.
 public  void firePropertyChange(String name,
    Object oldValue,
    Object newValue) 
    Report a bound property update to any registered listeners. No event is fired if old and new are equal and non-null.
 public  void fireVetoableChange(String name,
    Object oldValue,
    Object newValue) throws PropertyVetoException 
    Report a vetoable property update to any registered listeners. If anyone vetos the change, then fire a new event reverting everyone to the old value and then rethrow the PropertyVetoException.

    No event is fired if old and new are equal and non-null.

 public synchronized BeanContext getBeanContext() 
    Gets the nesting BeanContext for this BeanContextChildSupport.
 public BeanContextChild getBeanContextChildPeer() 
    Gets the BeanContextChild associated with this BeanContextChildSupport.
 protected  void initializeBeanContextResources() 
    This method may be overridden by subclasses to provide their own initialization behaviors. When invoked any resources requried by the BeanContextChild should be obtained from the current BeanContext.
 public boolean isDelegated() 
    Reports whether or not this class is a delegate of another.
 protected  void releaseBeanContextResources() 
    This method may be overridden by subclasses to provide their own release behaviors. When invoked any resources held by this instance obtained from its current BeanContext property should be released since the object is no longer nested within that BeanContext.
 public  void removePropertyChangeListener(String name,
    PropertyChangeListener pcl) 
    Remove a PropertyChangeListener for a specific property. If pcl was added more than once to the same event source for the specified property, it will be notified one less time after being removed. If name is null, no exception is thrown and no action is taken. If pcl is null, or was never added for the specified property, no exception is thrown and no action is taken.
 public  void removeVetoableChangeListener(String name,
    VetoableChangeListener vcl) 
    Removes a VetoableChangeListener. If pcl was added more than once to the same event source for the specified property, it will be notified one less time after being removed. If name is null, no exception is thrown and no action is taken. If vcl is null, or was never added for the specified property, no exception is thrown and no action is taken.
 public  void serviceAvailable(BeanContextServiceAvailableEvent bcsae) 
    A new service is available from the nesting BeanContext. Subclasses may override this method in order to implement their own behaviors
 public  void serviceRevoked(BeanContextServiceRevokedEvent bcsre) 
    A service provided by the nesting BeanContext has been revoked. Subclasses may override this method in order to implement their own behaviors.
 public synchronized  void setBeanContext(BeanContext bc) throws PropertyVetoException 
    Sets the BeanContext for this BeanContextChildSupport.
 public boolean validatePendingSetBeanContext(BeanContext newValue) 
    Called from setBeanContext to validate (or otherwise) the pending change in the nesting BeanContext property value. Returning false will cause setBeanContext to throw PropertyVetoException.