Methods Summary |
---|
public void | addPropertyChangeListener(java.lang.String name, java.beans.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.
pcSupport.addPropertyChangeListener(name, pcl);
|
public void | addVetoableChangeListener(java.lang.String name, java.beans.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.
vcSupport.addVetoableChangeListener(name, vcl);
|
public void | firePropertyChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)Report a bound property update to any registered listeners. No event is
fired if old and new are equal and non-null.
pcSupport.firePropertyChange(name, oldValue, newValue);
|
public void | fireVetoableChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)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.
vcSupport.fireVetoableChange(name, oldValue, newValue);
|
public synchronized java.beans.beancontext.BeanContext | getBeanContext()Gets the nesting BeanContext
for this BeanContextChildSupport . return beanContext;
|
public java.beans.beancontext.BeanContextChild | getBeanContextChildPeer()Gets the BeanContextChild associated with this
BeanContextChildSupport. return beanContextChildPeer;
|
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.
// do nothing
|
public boolean | isDelegated()Reports whether or not this class is a delegate of another. return !this.equals(beanContextChildPeer);
|
private void | readObject(java.io.ObjectInputStream ois)Restore a persistent object, must wait for subsequent setBeanContext()
to fully restore any resources obtained from the new nesting
BeanContext
ois.defaultReadObject();
|
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.
// do nothing
|
public void | removePropertyChangeListener(java.lang.String name, java.beans.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.
pcSupport.removePropertyChangeListener(name, pcl);
|
public void | removeVetoableChangeListener(java.lang.String name, java.beans.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.
vcSupport.removeVetoableChangeListener(name, vcl);
|
public void | serviceAvailable(java.beans.beancontext.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(java.beans.beancontext.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(java.beans.beancontext.BeanContext bc)Sets the BeanContext for
this BeanContextChildSupport .
if (bc == beanContext) return;
BeanContext oldValue = beanContext;
BeanContext newValue = bc;
if (!rejectedSetBCOnce) {
if (rejectedSetBCOnce = !validatePendingSetBeanContext(bc)) {
throw new PropertyVetoException(
"setBeanContext() change rejected:",
new PropertyChangeEvent(beanContextChildPeer, "beanContext", oldValue, newValue)
);
}
try {
fireVetoableChange("beanContext",
oldValue,
newValue
);
} catch (PropertyVetoException pve) {
rejectedSetBCOnce = true;
throw pve; // re-throw
}
}
if (beanContext != null) releaseBeanContextResources();
beanContext = newValue;
rejectedSetBCOnce = false;
firePropertyChange("beanContext",
oldValue,
newValue
);
if (beanContext != null) initializeBeanContextResources();
|
public boolean | validatePendingSetBeanContext(java.beans.beancontext.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.
return true;
|
private void | writeObject(java.io.ObjectOutputStream oos)Write the persistence state of the object.
/*
* dont serialize if we are delegated and the delegator isnt also
* serializable.
*/
if (!equals(beanContextChildPeer) && !(beanContextChildPeer instanceof Serializable))
throw new IOException("BeanContextChildSupport beanContextChildPeer not Serializable");
else
oos.defaultWriteObject();
|