java.beans.beancontext
Interface BeanContextChild

All Known Subinterfaces:
BeanContext sample code for java.beans.beancontext.BeanContext definition code for java.beans.beancontext.BeanContext , BeanContextServices sample code for java.beans.beancontext.BeanContextServices definition code for java.beans.beancontext.BeanContextServices
All Known Implementing Classes:
BeanContextChildSupport sample code for java.beans.beancontext.BeanContextChildSupport definition code for java.beans.beancontext.BeanContextChildSupport , BeanContextServicesSupport sample code for java.beans.beancontext.BeanContextServicesSupport definition code for java.beans.beancontext.BeanContextServicesSupport , BeanContextSupport sample code for java.beans.beancontext.BeanContextSupport definition code for java.beans.beancontext.BeanContextSupport

public interface BeanContextChild

JavaBeans wishing to be nested within, and obtain a reference to their execution environment, or context, as defined by the BeanContext sub-interface shall implement this interface.

Conformant BeanContexts shall as a side effect of adding a BeanContextChild object shall pass a reference to itself via the setBeanContext() method of this interface.

Note that a BeanContextChild may refuse a change in state by throwing PropertyVetoedException in response.

In order for persistence mechanisms to function properly on BeanContextChild instances across a broad variety of scenarios, implementing classes of this interface are required to define as transient, any or all fields, or instance variables, that may contain, or represent, references to the nesting BeanContext instance or other resources obtained from the BeanContext via any unspecified mechanisms.

Since:
1.2
See Also:
BeanContext sample code for java.beans.beancontext.BeanContext definition code for java.beans.beancontext.BeanContext , PropertyChangeEvent sample code for java.beans.PropertyChangeEvent definition code for java.beans.PropertyChangeEvent , PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener , java.beans.PropertyVetoEvent, java.beans.PropertyVetoListener, PropertyVetoException sample code for java.beans.PropertyVetoException definition code for java.beans.PropertyVetoException

Method Summary
 void addPropertyChangeListener sample code for java.beans.beancontext.BeanContextChild.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.beans.beancontext.BeanContextChild.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) (String sample code for java.lang.String definition code for java.lang.String  name, PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener  pcl)
          Adds a PropertyChangeListener to this BeanContextChild in order to receive a PropertyChangeEvent whenever the specified property has changed.
 void addVetoableChangeListener sample code for java.beans.beancontext.BeanContextChild.addVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener) definition code for java.beans.beancontext.BeanContextChild.addVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener) (String sample code for java.lang.String definition code for java.lang.String  name, VetoableChangeListener sample code for java.beans.VetoableChangeListener definition code for java.beans.VetoableChangeListener  vcl)
          Adds a VetoableChangeListener to this BeanContextChild to receive events whenever the specified property changes.
 BeanContext sample code for java.beans.beancontext.BeanContext definition code for java.beans.beancontext.BeanContext getBeanContext sample code for java.beans.beancontext.BeanContextChild.getBeanContext() definition code for java.beans.beancontext.BeanContextChild.getBeanContext() ()
          Gets the BeanContext associated with this BeanContextChild.
 void removePropertyChangeListener sample code for java.beans.beancontext.BeanContextChild.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.beans.beancontext.BeanContextChild.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) (String sample code for java.lang.String definition code for java.lang.String  name, PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener  pcl)
          Removes a PropertyChangeListener from this BeanContextChild so that it no longer receives PropertyChangeEvents when the specified property is changed.
 void removeVetoableChangeListener sample code for java.beans.beancontext.BeanContextChild.removeVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener) definition code for java.beans.beancontext.BeanContextChild.removeVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener) (String sample code for java.lang.String definition code for java.lang.String  name, VetoableChangeListener sample code for java.beans.VetoableChangeListener definition code for java.beans.VetoableChangeListener  vcl)
          Removes a VetoableChangeListener from this BeanContextChild so that it no longer receives events when the specified property changes.
 void setBeanContext sample code for java.beans.beancontext.BeanContextChild.setBeanContext(java.beans.beancontext.BeanContext) definition code for java.beans.beancontext.BeanContextChild.setBeanContext(java.beans.beancontext.BeanContext) (BeanContext sample code for java.beans.beancontext.BeanContext definition code for java.beans.beancontext.BeanContext  bc)
           Objects that implement this interface, shall fire a java.beans.PropertyChangeEvent, with parameters: propertyName "beanContext", oldValue (the previous nesting BeanContext instance, or null), newValue (the current nesting BeanContext instance, or null).
 

Method Detail

setBeanContext sample code for java.beans.beancontext.BeanContextChild.setBeanContext(java.beans.beancontext.BeanContext) definition code for java.beans.beancontext.BeanContextChild.setBeanContext(java.beans.beancontext.BeanContext)

void setBeanContext(BeanContext sample code for java.beans.beancontext.BeanContext definition code for java.beans.beancontext.BeanContext  bc)
                    throws PropertyVetoException sample code for java.beans.PropertyVetoException definition code for java.beans.PropertyVetoException 

Objects that implement this interface, shall fire a java.beans.PropertyChangeEvent, with 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.

Parameters:
bc - The BeanContext with which to associate this BeanContextChild.
Throws:
PropertyVetoException - if the addition of the specified BeanContext is refused.
PropertyVetoException sample code for java.beans.PropertyVetoException definition code for java.beans.PropertyVetoException

getBeanContext sample code for java.beans.beancontext.BeanContextChild.getBeanContext() definition code for java.beans.beancontext.BeanContextChild.getBeanContext()

BeanContext sample code for java.beans.beancontext.BeanContext definition code for java.beans.beancontext.BeanContext  getBeanContext()
Gets the BeanContext associated with this BeanContextChild.

Returns:
the BeanContext associated with this BeanContextChild.

addPropertyChangeListener sample code for java.beans.beancontext.BeanContextChild.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.beans.beancontext.BeanContextChild.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)

void addPropertyChangeListener(String sample code for java.lang.String definition code for java.lang.String  name,
                               PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener  pcl)
Adds a PropertyChangeListener to this BeanContextChild in order to receive a PropertyChangeEvent whenever the specified property has changed.

Parameters:
name - the name of the property to listen on
pcl - the PropertyChangeListener to add

removePropertyChangeListener sample code for java.beans.beancontext.BeanContextChild.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.beans.beancontext.BeanContextChild.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)

void removePropertyChangeListener(String sample code for java.lang.String definition code for java.lang.String  name,
                                  PropertyChangeListener sample code for java.beans.PropertyChangeListener definition code for java.beans.PropertyChangeListener  pcl)
Removes a PropertyChangeListener from this BeanContextChild so that it no longer receives PropertyChangeEvents when the specified property is changed.

Parameters:
name - the name of the property that was listened on
pcl - the PropertyChangeListener to remove

addVetoableChangeListener sample code for java.beans.beancontext.BeanContextChild.addVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener) definition code for java.beans.beancontext.BeanContextChild.addVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener)

void addVetoableChangeListener(String sample code for java.lang.String definition code for java.lang.String  name,
                               VetoableChangeListener sample code for java.beans.VetoableChangeListener definition code for java.beans.VetoableChangeListener  vcl)
Adds a VetoableChangeListener to this BeanContextChild to receive events whenever the specified property changes.

Parameters:
name - the name of the property to listen on
vcl - the VetoableChangeListener to add

removeVetoableChangeListener sample code for java.beans.beancontext.BeanContextChild.removeVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener) definition code for java.beans.beancontext.BeanContextChild.removeVetoableChangeListener(java.lang.String, java.beans.VetoableChangeListener)

void removeVetoableChangeListener(String sample code for java.lang.String definition code for java.lang.String  name,
                                  VetoableChangeListener sample code for java.beans.VetoableChangeListener definition code for java.beans.VetoableChangeListener  vcl)
Removes a VetoableChangeListener from this BeanContextChild so that it no longer receives events when the specified property changes.

Parameters:
name - the name of the property that was listened on.
vcl - the VetoableChangeListener to remove.