java.lang.Object | |
↳ | java.beans.beancontext.BeanContextChildSupport |
Known Direct Subclasses |
Known Indirect Subclasses |
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.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
beanContext | |||||||||||
beanContextChildPeer | The BeanContext in which
this BeanContextChild is nested. |
||||||||||
pcSupport | The PropertyChangeSupport associated with this BeanContextChildSupport. | ||||||||||
rejectedSetBCOnce | A flag indicating that there has been
at least one PropertyChangeVetoException
thrown for the attempted setBeanContext operation. |
||||||||||
vcSupport | The VetoableChangeSupport associated with this BeanContextChildSupport. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
construct a BeanContextChildSupport where this class has been
subclassed in order to implement the JavaBean component itself.
| |||||||||||
construct a BeanContextChildSupport where the JavaBean component
itself implements BeanContextChild, and encapsulates this, delegating
that interface to this implementation
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add a PropertyChangeListener for a specific property.
| |||||||||||
Add a VetoableChangeListener for a specific property.
| |||||||||||
Report a bound property update to any registered listeners.
| |||||||||||
Report a vetoable property update to any registered listeners.
| |||||||||||
Gets the nesting
BeanContext
for this BeanContextChildSupport . | |||||||||||
Gets the BeanContextChild associated with this
BeanContextChildSupport.
| |||||||||||
Reports whether or not this class is a delegate of another.
| |||||||||||
Remove a PropertyChangeListener for a specific property.
| |||||||||||
Removes a
VetoableChangeListener . | |||||||||||
A new service is available from the nesting BeanContext.
| |||||||||||
A service provided by the nesting BeanContext has been revoked.
| |||||||||||
Sets the
BeanContext for
this BeanContextChildSupport . | |||||||||||
Called from setBeanContext to validate (or otherwise) the
pending change in the nesting BeanContext property value.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method may be overridden by subclasses to provide their own
initialization behaviors.
| |||||||||||
This method may be overridden by subclasses to provide their own
release behaviors.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.beans.beancontext.BeanContextChild
| |||||||||||
From interface
java.beans.beancontext.BeanContextServiceRevokedListener
| |||||||||||
From interface
java.beans.beancontext.BeanContextServicesListener
|
The BeanContext
in which
this BeanContextChild
is nested.
The PropertyChangeSupport associated with this BeanContextChildSupport.
A flag indicating that there has been
at least one PropertyChangeVetoException
thrown for the attempted setBeanContext operation.
The VetoableChangeSupport associated with this BeanContextChildSupport.
construct a BeanContextChildSupport where this class has been subclassed in order to implement the JavaBean component itself.
construct a BeanContextChildSupport where the JavaBean component itself implements BeanContextChild, and encapsulates this, delegating that interface to this implementation
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.
name | The name of the property to listen on |
---|---|
pcl | The PropertyChangeListener to be added
|
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.
name | The name of the property to listen on |
---|---|
vcl | The VetoableChangeListener to be added
|
Report a bound property update to any registered listeners. No event is fired if old and new are equal and non-null.
name | The programmatic name of the property that was changed |
---|---|
oldValue | The old value of the property |
newValue | The new value of the property |
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.
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. |
---|
Gets the nesting BeanContext
for this BeanContextChildSupport
.
BeanContext
for
this BeanContextChildSupport
.
Gets the BeanContextChild associated with this BeanContextChildSupport.
Reports whether or not this class is a delegate of another.
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.
name | The name of the property that was listened on |
---|---|
pcl | The PropertyChangeListener to be removed |
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.
name | The name of the property that was listened on |
---|---|
vcl | The VetoableChangeListener to be removed
|
A new service is available from the nesting BeanContext. Subclasses may override this method in order to implement their own behaviors
bcsae | The BeanContextServiceAvailableEvent fired as a result of a service becoming available |
---|
A service provided by the nesting BeanContext has been revoked. Subclasses may override this method in order to implement their own behaviors.
bcsre | The BeanContextServiceRevokedEvent fired as a
result of a service being revoked
|
---|
Sets the BeanContext
for
this BeanContextChildSupport
.
bc | the new value to be assigned to the BeanContext
property |
---|
if the change is rejected | |
PropertyVetoException |
Called from setBeanContext to validate (or otherwise) the pending change in the nesting BeanContext property value. Returning false will cause setBeanContext to throw PropertyVetoException.
newValue | the new value that has been requested for the BeanContext property |
---|
true
if the change operation is to be vetoed
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.
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.