JavaTM 2 Platform
Standard Edition

java.beans.beancontext
Class BeanContextChildSupport

java.lang.Object
  |
  +--java.beans.beancontext.BeanContextChildSupport
Direct Known Subclasses:
BeanContextSupport

public class BeanContextChildSupport
extends Object
implements BeanContextChild, BeanContextServicesListener, Serializable

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.

Since:
JDK1.2
See Also:
Serialized Form

Field Summary
protected  BeanContext beanContext
           
 BeanContextChild beanContextChildPeer
           
protected  PropertyChangeSupport pcSupport
           
protected  boolean rejectedSetBCOnce
           
protected  VetoableChangeSupport vcSupport
           
 
Constructor Summary
BeanContextChildSupport()
          construct a BeanContextChildSupport where this class has been subclassed in order to implement the JavaBean component itself.
BeanContextChildSupport(BeanContextChild bcc)
          construct a BeanContextChildSupport where the JavaBean component itself implements BeanContextChild, and encapsulates this, delegating that interface to this implementation
 
Method Summary
 void addPropertyChangeListener(String name, PropertyChangeListener pcl)
          add a property change listener
 void addVetoableChangeListener(String name, VetoableChangeListener vcl)
          add a vetoable change listener
 void firePropertyChange(String name, Object oldValue, Object newValue)
          fires a propertyChange Event
 void fireVetoableChange(String name, Object oldValue, Object newValue)
          fires a vetoableChange Event
 BeanContext getBeanContext()
           
 BeanContextChild getBeanContextChildPeer()
           
protected  void initializeBeanContextResources()
          This method may be overridden by subclasses to provide their own initialization behaviors.
 boolean isDelegated()
           
protected  void releaseBeanContextResources()
          This method may be overridden by subclasses to provide their own release behaviors.
 void removePropertyChangeListener(String name, PropertyChangeListener pcl)
          remove a property change listener
 void removeVetoableChangeListener(String name, VetoableChangeListener vcl)
          remove a vetoable change listener
 void serviceAvailable(BeanContextServiceAvailableEvent bcsae)
          a new service is available from the nesting BeanContext.
 void serviceRevoked(BeanContextServiceRevokedEvent bcsre)
          a service provided by the nesting BeanContext has been revoked.
 void setBeanContext(BeanContext bc)
          setBeanContext
 boolean validatePendingSetBeanContext(BeanContext newValue)
          called from setBeanContext to validate (or otherwise) the pending change in the nesting BeanContext property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

beanContextChildPeer

public BeanContextChild beanContextChildPeer

pcSupport

protected PropertyChangeSupport pcSupport

vcSupport

protected VetoableChangeSupport vcSupport

beanContext

protected transient BeanContext beanContext

rejectedSetBCOnce

protected transient boolean rejectedSetBCOnce
Constructor Detail

BeanContextChildSupport

public BeanContextChildSupport()
construct a BeanContextChildSupport where this class has been subclassed in order to implement the JavaBean component itself.

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 Detail

setBeanContext

public void setBeanContext(BeanContext bc)
                    throws PropertyVetoException
setBeanContext
Specified by:
setBeanContext in interface BeanContextChild
Tags copied from interface: BeanContextChild
Parameters:
propertyName - "beanContext"
oldValue - the previous nesting BeanContext instance, or null
newValue - the current nesting BeanContext instance, or null

A change in the value of the nesting BeanContext property of this BeanContextChild may be vetoed by throwing the appropriate exception.


getBeanContext

public BeanContext getBeanContext()
Specified by:
getBeanContext in interface BeanContextChild

addPropertyChangeListener

public void addPropertyChangeListener(String name,
                                      PropertyChangeListener pcl)
add a property change listener
Specified by:
addPropertyChangeListener in interface BeanContextChild

removePropertyChangeListener

public void removePropertyChangeListener(String name,
                                         PropertyChangeListener pcl)
remove a property change listener
Specified by:
removePropertyChangeListener in interface BeanContextChild

addVetoableChangeListener

public void addVetoableChangeListener(String name,
                                      VetoableChangeListener vcl)
add a vetoable change listener
Specified by:
addVetoableChangeListener in interface BeanContextChild

removeVetoableChangeListener

public void removeVetoableChangeListener(String name,
                                         VetoableChangeListener vcl)
remove a vetoable change listener
Specified by:
removeVetoableChangeListener in interface BeanContextChild

serviceRevoked

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

serviceAvailable

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
Specified by:
serviceAvailable in interface BeanContextServicesListener

getBeanContextChildPeer

public BeanContextChild getBeanContextChildPeer()
Returns:
the BeanContextChild peer of this class

isDelegated

public boolean isDelegated()
Returns:
true if this class is a delegate of another

firePropertyChange

public void firePropertyChange(String name,
                               Object oldValue,
                               Object newValue)
fires a propertyChange Event

fireVetoableChange

public void fireVetoableChange(String name,
                               Object oldValue,
                               Object newValue)
                        throws PropertyVetoException
fires a vetoableChange Event

validatePendingSetBeanContext

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.

releaseBeanContextResources

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.

initializeBeanContextResources

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.

JavaTM 2 Platform
Standard Edition

Submit a bug or feature
Java, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.