APIdia Launch Partner
Top Description Fields Constructors Methods
java.beans.beancontext

public Class BeanContextChildSupport

extends Object
implements BeanContextChild, BeanContextServicesListener, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.beans.beancontext.BeanContextServicesListener, java.beans.beancontext.BeanContextServiceRevokedListener, java.util.EventListener, java.beans.beancontext.BeanContextChild
Known Direct Subclasses
java.beans.beancontext.BeanContextSupport
Annotations
@SuppressWarnings:removal
@Deprecated
since:23
forRemoval:true
Imports
java.beans.PropertyChangeEvent, .PropertyChangeListener, .PropertyChangeSupport, .PropertyVetoException, .VetoableChangeListener, .VetoableChangeSupport, java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serial, .Serializable

Deprecated

for removal since 23.

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.

Author
Laurence P. G. Cable
Since
1.2
See Also
java.beans.beancontext.BeanContext, java.beans.beancontext.BeanContextServices, java.beans.beancontext.BeanContextChild

Field Summary

Modifier and TypeField and Description
protected transient BeanContext
beanContext

References Deprecated BeanContext is deprecated or references (maybe indirectly) at least one deprecated element.
The bean context.
public BeanContextChild
beanContextChildPeer

References Deprecated BeanContextChild is deprecated or references (maybe indirectly) at least one deprecated element.
The BeanContext in which this BeanContextChild is nested.
protected PropertyChangeSupport
pcSupport

The PropertyChangeSupport associated with this BeanContextChildSupport.

protected transient boolean
rejectedSetBCOnce

A flag indicating that there has been at least one PropertyChangeVetoException thrown for the attempted setBeanContext operation.

private static final long
serialVersionUID

Use serialVersionUID from JDK 1.2 for interoperability.

protected VetoableChangeSupport
vcSupport

The VetoableChangeSupport associated with this BeanContextChildSupport.

Constructor Summary

AccessConstructor and Description
public
BeanContextChildSupport()

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

public
BeanContextChildSupport(BeanContextChild
the underlying bean context child
bcc
)
References Deprecated BeanContextChild is deprecated or references (maybe indirectly) at least one deprecated element.

construct a BeanContextChildSupport where the JavaBean component itself implements BeanContextChild, and encapsulates this, delegating that interface to this implementation

Method Summary

Modifier and TypeMethod and Description
public void
addPropertyChangeListener(String
The name of the property to listen on
name
,
PropertyChangeListener
The PropertyChangeListener to be added
pcl
)

Implements java.beans.beancontext.BeanContextChild.addPropertyChangeListener.

Add a PropertyChangeListener for a specific property.

public void
addVetoableChangeListener(String
The name of the property to listen on
name
,
VetoableChangeListener
The VetoableChangeListener to be added
vcl
)

Implements java.beans.beancontext.BeanContextChild.addVetoableChangeListener.

Add a VetoableChangeListener for a specific property.

public void
firePropertyChange(String
The programmatic name of the property that was changed
name
,
Object
The old value of the property
oldValue
,
Object
The new value of the property
newValue
)

Report a bound property update to any registered listeners.

public void
fireVetoableChange(String
The programmatic name of the property that is about to change
name
,
Object
The old value of the property
oldValue
,
Object
- The new value of the property
newValue
)

Report a vetoable property update to any registered listeners.

public synchronized BeanContext

Returns:

the nesting BeanContext for this BeanContextChildSupport.
getBeanContext
()

Implements java.beans.beancontext.BeanContextChild.getBeanContext.

References Deprecated BeanContext is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the nesting BeanContext for this BeanContextChildSupport.

public BeanContextChild

Returns:

the BeanContextChild peer of this class
getBeanContextChildPeer
()
References Deprecated BeanContextChild is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the BeanContextChild associated with this BeanContextChildSupport.

protected void
initializeBeanContextResources()

This method may be overridden by subclasses to provide their own initialization behaviors.

public boolean

Returns:

true if this class is a delegate of another
isDelegated
()

Reports whether or not this class is a delegate of another.

private void
readObject(ObjectInputStream
the ObjectInputStream to read
ois
)

Restore a persistent object, must wait for subsequent setBeanContext() to fully restore any resources obtained from the new nesting BeanContext.

protected void
releaseBeanContextResources()

This method may be overridden by subclasses to provide their own release behaviors.

public void
removePropertyChangeListener(String
The name of the property that was listened on
name
,
PropertyChangeListener
The PropertyChangeListener to be removed
pcl
)

Implements java.beans.beancontext.BeanContextChild.removePropertyChangeListener.

Remove a PropertyChangeListener for a specific property.

public void
removeVetoableChangeListener(String
The name of the property that was listened on
name
,
VetoableChangeListener
The VetoableChangeListener to be removed
vcl
)

Implements java.beans.beancontext.BeanContextChild.removeVetoableChangeListener.

Removes a VetoableChangeListener.

public void
serviceAvailable(BeanContextServiceAvailableEvent
The BeanContextServiceAvailableEvent fired as a result of a service becoming available
bcsae
)

Implements java.beans.beancontext.BeanContextServicesListener.serviceAvailable.

References Deprecated BeanContextServiceAvailableEvent is deprecated or references (maybe indirectly) at least one deprecated element.

A new service is available from the nesting BeanContext.

public void
serviceRevoked(BeanContextServiceRevokedEvent
The BeanContextServiceRevokedEvent fired as a result of a service being revoked
bcsre
)

Implements java.beans.beancontext.BeanContextServiceRevokedListener.serviceRevoked.

References Deprecated BeanContextServiceRevokedEvent is deprecated or references (maybe indirectly) at least one deprecated element.

A service provided by the nesting BeanContext has been revoked.

public synchronized void
setBeanContext(BeanContext
the new value to be assigned to the BeanContext property
bc
)

Implements java.beans.beancontext.BeanContextChild.setBeanContext.

References Deprecated BeanContext is deprecated or references (maybe indirectly) at least one deprecated element.

Sets the BeanContext for this BeanContextChildSupport.

public boolean

Returns:

true if the change operation is to be vetoed
validatePendingSetBeanContext
(BeanContext
the new value that has been requested for the BeanContext property
newValue
)
References Deprecated BeanContext is deprecated or references (maybe indirectly) at least one deprecated element.

Called from setBeanContext to validate (or otherwise) the pending change in the nesting BeanContext property value.

private void
writeObject(ObjectOutputStream
the ObjectOutputStream to write
oos
)

Write the persistence state of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanContextback to summary
protected transient BeanContext beanContext

References Deprecated

BeanContext is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The bean context.

beanContextChildPeerback to summary
public BeanContextChild beanContextChildPeer

References Deprecated

BeanContextChild is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

The BeanContext in which this BeanContextChild is nested.

Annotations
@SuppressWarnings:serial
pcSupportback to summary
protected PropertyChangeSupport pcSupport

The PropertyChangeSupport associated with this BeanContextChildSupport.

rejectedSetBCOnceback to summary
protected transient boolean rejectedSetBCOnce

A flag indicating that there has been at least one PropertyChangeVetoException thrown for the attempted setBeanContext operation.

serialVersionUIDback to summary
private static final long serialVersionUID

Use serialVersionUID from JDK 1.2 for interoperability.

Annotations
@Serial
vcSupportback to summary
protected VetoableChangeSupport vcSupport

The VetoableChangeSupport associated with this BeanContextChildSupport.

Constructor Detail

BeanContextChildSupportback to summary
public BeanContextChildSupport()

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

BeanContextChildSupportback to summary
public BeanContextChildSupport(BeanContextChild bcc)

References Deprecated

BeanContextChild is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

construct a BeanContextChildSupport where the JavaBean component itself implements BeanContextChild, and encapsulates this, delegating that interface to this implementation

Parameters
bcc:BeanContextChild

the underlying bean context child

Method Detail

addPropertyChangeListenerback to summary
public void addPropertyChangeListener(String name, PropertyChangeListener pcl)

Implements java.beans.beancontext.BeanContextChild.addPropertyChangeListener.

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.

Parameters
name:String

The name of the property to listen on

pcl:PropertyChangeListener

The PropertyChangeListener to be added

Annotations
@Override
addVetoableChangeListenerback to summary
public void addVetoableChangeListener(String name, VetoableChangeListener vcl)

Implements java.beans.beancontext.BeanContextChild.addVetoableChangeListener.

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.

Parameters
name:String

The name of the property to listen on

vcl:VetoableChangeListener

The VetoableChangeListener to be added

Annotations
@Override
firePropertyChangeback to summary
public void firePropertyChange(String name, Object oldValue, Object newValue)

Report a bound property update to any registered listeners. No event is fired if old and new are equal and non-null.

Parameters
name:String

The programmatic name of the property that was changed

oldValue:Object

The old value of the property

newValue:Object

The new value of the property

fireVetoableChangeback to summary
public void fireVetoableChange(String name, Object oldValue, Object newValue) throws PropertyVetoException

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.

Parameters
name:String

The programmatic name of the property that is about to change

oldValue:Object

The old value of the property

newValue:Object

- The new value of the property

Exceptions
PropertyVetoException:
if the recipient wishes the property change to be rolled back.
getBeanContextback to summary
public synchronized BeanContext getBeanContext()

Implements java.beans.beancontext.BeanContextChild.getBeanContext.

References Deprecated

BeanContext is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the nesting BeanContext for this BeanContextChildSupport.

Returns:BeanContext

the nesting BeanContext for this BeanContextChildSupport.

Annotations
@Override
getBeanContextChildPeerback to summary
public BeanContextChild getBeanContextChildPeer()

References Deprecated

BeanContextChild is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the BeanContextChild associated with this BeanContextChildSupport.

Returns:BeanContextChild

the BeanContextChild peer of this class

initializeBeanContextResourcesback to summary
protected void initializeBeanContextResources()

This method may be overridden by subclasses to provide their own initialization behaviors. When invoked any resources required by the BeanContextChild should be obtained from the current BeanContext.

isDelegatedback to summary
public boolean isDelegated()

Reports whether or not this class is a delegate of another.

Returns:boolean

true if this class is a delegate of another

readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException

Restore a persistent object, must wait for subsequent setBeanContext() to fully restore any resources obtained from the new nesting BeanContext.

Parameters
ois:ObjectInputStream

the ObjectInputStream to read

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if the class of a serialized object could not be found
releaseBeanContextResourcesback to summary
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.

removePropertyChangeListenerback to summary
public void removePropertyChangeListener(String name, PropertyChangeListener pcl)

Implements java.beans.beancontext.BeanContextChild.removePropertyChangeListener.

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.

Parameters
name:String

The name of the property that was listened on

pcl:PropertyChangeListener

The PropertyChangeListener to be removed

Annotations
@Override
removeVetoableChangeListenerback to summary
public void removeVetoableChangeListener(String name, VetoableChangeListener vcl)

Implements java.beans.beancontext.BeanContextChild.removeVetoableChangeListener.

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.

Parameters
name:String

The name of the property that was listened on

vcl:VetoableChangeListener

The VetoableChangeListener to be removed

Annotations
@Override
serviceAvailableback to summary
public void serviceAvailable(BeanContextServiceAvailableEvent bcsae)

Implements java.beans.beancontext.BeanContextServicesListener.serviceAvailable.

References Deprecated

BeanContextServiceAvailableEvent is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

A new service is available from the nesting BeanContext. Subclasses may override this method in order to implement their own behaviors

Parameters
bcsae:BeanContextServiceAvailableEvent

The BeanContextServiceAvailableEvent fired as a result of a service becoming available

Annotations
@Override
serviceRevokedback to summary
public void serviceRevoked(BeanContextServiceRevokedEvent bcsre)

Implements java.beans.beancontext.BeanContextServiceRevokedListener.serviceRevoked.

References Deprecated

BeanContextServiceRevokedEvent is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

A service provided by the nesting BeanContext has been revoked. Subclasses may override this method in order to implement their own behaviors.

Parameters
bcsre:BeanContextServiceRevokedEvent

The BeanContextServiceRevokedEvent fired as a result of a service being revoked

Annotations
@Override
setBeanContextback to summary
public synchronized void setBeanContext(BeanContext bc) throws PropertyVetoException

Implements java.beans.beancontext.BeanContextChild.setBeanContext.

References Deprecated

BeanContext is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Sets the BeanContext for this BeanContextChildSupport.

Parameters
bc:BeanContext

the new value to be assigned to the BeanContext property

Annotations
@Override
Exceptions
PropertyVetoException:
if the change is rejected
validatePendingSetBeanContextback to summary
public boolean validatePendingSetBeanContext(BeanContext newValue)

References Deprecated

BeanContext is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Called from setBeanContext to validate (or otherwise) the pending change in the nesting BeanContext property value. Returning false will cause setBeanContext to throw PropertyVetoException.

Parameters
newValue:BeanContext

the new value that has been requested for the BeanContext property

Returns:boolean

true if the change operation is to be vetoed

writeObjectback to summary
private void writeObject(ObjectOutputStream oos) throws IOException

Write the persistence state of the object.

Parameters
oos:ObjectOutputStream

the ObjectOutputStream to write

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs