public class BeanContextChildSupport extends Objectimplements 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.
BeanContext,
BeanContextServices,
BeanContextChild,
Serialized Form
| Modifier and Type | Field and Description |
|---|---|
protected BeanContext |
beanContext
The bean context.
|
BeanContextChild |
beanContextChildPeer
The
BeanContext in which this
BeanContextChild is nested.
|
protected PropertyChangeSupport |
pcSupport
The
PropertyChangeSupport associated with this
BeanContextChildSupport.
|
protected boolean |
rejectedSetBCOnce
A flag indicating that there has been at least one
PropertyChangeVetoException thrown for the attempted setBeanContext operation.
|
protected VetoableChangeSupport |
vcSupport
The
VetoableChangeSupport associated with this
BeanContextChildSupport.
|
| Constructor and Description |
|---|
BeanContextChildSupport()
construct a BeanContextChildSupport where this class has been subclassed in order to implement the JavaBean component itself.
|
BeanContextChildSupport(BeanContextChild
construct a BeanContextChildSupport where the JavaBean component itself implements BeanContextChild, and encapsulates this, delegating that interface to this implementation
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(String
Add a PropertyChangeListener for a specific property.
|
void |
addVetoableChangeListener(String
Add a VetoableChangeListener for a specific property.
|
void |
firePropertyChange(String
Report a bound property update to any registered listeners.
|
void |
fireVetoableChange(String
Report a vetoable property update to any registered listeners.
|
BeanContext |
getBeanContext()
Gets the nesting
BeanContext for this
BeanContextChildSupport.
|
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.
|
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.
|
void |
removePropertyChangeListener(String
Remove a PropertyChangeListener for a specific property.
|
void |
removeVetoableChangeListener(String
Removes a
VetoableChangeListener.
|
void |
serviceAvailable(BeanContextServiceAvailableEvent
A new service is available from the nesting BeanContext.
|
void |
serviceRevoked(BeanContextServiceRevokedEvent
A service provided by the nesting BeanContext has been revoked.
|
void |
setBeanContext(BeanContext
Sets the
BeanContext for this
BeanContextChildSupport.
|
boolean |
validatePendingSetBeanContext(BeanContext
Called from setBeanContext to validate (or otherwise) the pending change in the nesting BeanContext property value.
|
public BeanContextChildbeanContextChildPeer
BeanContext in which this
BeanContextChild is nested.
protected PropertyChangeSupportpcSupport
protected VetoableChangeSupportvcSupport
protected transient BeanContextbeanContext
protected transient boolean rejectedSetBCOnce
PropertyChangeVetoException thrown for the attempted setBeanContext operation.
public BeanContextChildSupport()
public BeanContextChildSupport(BeanContextChildbcc)
bcc - the underlying bean context child
public void setBeanContext(BeanContextbc) throws PropertyVetoException
BeanContext for this
BeanContextChildSupport.
setBeanContext in interface
BeanContextChild
bc - the new value to be assigned to the
BeanContext property
PropertyVetoException - if the change is rejected
public BeanContextgetBeanContext()
BeanContext for this
BeanContextChildSupport.
getBeanContext in interface
BeanContextChild
BeanContext for this
BeanContextChildSupport.
public void addPropertyChangeListener(Stringname, PropertyChangeListener pcl)
name or
pcl is null, no exception is thrown and no action is taken.
addPropertyChangeListener in interface
BeanContextChild
name - The name of the property to listen on
pcl - The
PropertyChangeListener to be added
public void removePropertyChangeListener(Stringname, PropertyChangeListener pcl)
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.
removePropertyChangeListener in interface
BeanContextChild
name - The name of the property that was listened on
pcl - The PropertyChangeListener to be removed
public void addVetoableChangeListener(Stringname, VetoableChangeListener vcl)
name or
vcl is null, no exception is thrown and no action is taken.
addVetoableChangeListener in interface
BeanContextChild
name - The name of the property to listen on
vcl - The
VetoableChangeListener to be added
public void removeVetoableChangeListener(Stringname, VetoableChangeListener vcl)
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.
removeVetoableChangeListener in interface
BeanContextChild
name - The name of the property that was listened on
vcl - The
VetoableChangeListener to be removed
public void serviceRevoked(BeanContextServiceRevokedEventbcsre)
serviceRevoked in interface
BeanContextServiceRevokedListener
bcsre - The
BeanContextServiceRevokedEvent fired as a result of a service being revoked
public void serviceAvailable(BeanContextServiceAvailableEventbcsae)
serviceAvailable in interface
BeanContextServicesListener
bcsae - The BeanContextServiceAvailableEvent fired as a result of a service becoming available
public BeanContextChildgetBeanContextChildPeer()
public boolean isDelegated()
public void firePropertyChange(Stringname, Object oldValue, Object newValue)
name - The programmatic name of the property that was changed
oldValue - The old value of the property
newValue - The new value of the property
public void fireVetoableChange(Stringname, Object oldValue, Object newValue) throws PropertyVetoException
No event is fired if old and new are equal and non-null.
name - The programmatic name of the property that is about to change
oldValue - The old value of the property
newValue - - The new value of the property
PropertyVetoException - if the recipient wishes the property change to be rolled back.
public boolean validatePendingSetBeanContext(BeanContextnewValue)
newValue - the new value that has been requested for the BeanContext property
true if the change operation is to be vetoed
protected void releaseBeanContextResources()
protected void initializeBeanContextResources()