API java : BeanContextChildSupport


java.beans.beancontext
Class BeanContextChildSupport

java.lang.Object
  extended by java.beans.beancontext.BeanContextChildSupport
All Implemented Interfaces:
BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, Serializable, EventListener
Direct Known Subclasses:
BeanContextSupport

public class BeanContextChildSupport
extends Object
implements 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.

Since:
1.2
See Also:
BeanContext, BeanContextServices, BeanContextChild, Serialized Form

Field Summary
protected  BeanContext beanContext
           
 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 Summary
BeanContextChildSupport()
          construct a BeanContextChildSupport where this class has been subclassed in order to implement the JavaBean component itself.
BeanContextChildSupport(BeanContextChild bcc)
          construct a BeanContextChildSupport where the JavaBean component itself implements BeanContextChild, and encapsulates this, delegating that interface to this implementation
 
Method Summary
 void addPropertyChangeListener(String name, PropertyChangeListener pcl)
          Add a PropertyChangeListener for a specific property.
 void addVetoableChangeListener(String name, VetoableChangeListener vcl)
          Add a VetoableChangeListener for a specific property.
 void firePropertyChange(String name, Object oldValue, Object newValue)
          Report a bound property update to any registered listeners.
 void fireVetoableChange(String name, Object oldValue, Object newValue)
          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 name, PropertyChangeListener pcl)
          Remove a PropertyChangeListener for a specific property.
 void removeVetoableChangeListener(String name, VetoableChangeListener vcl)
          Removes a VetoableChangeListener.
 void serviceAvailable(BeanContextServiceAvailableEvent bcsae)
          A new service is available from the nesting BeanContext.
 void serviceRevoked(BeanContextServiceRevokedEvent bcsre)
          A service provided by the nesting BeanContext has been revoked.
 void setBeanContext(BeanContext bc)
          Sets the BeanContext for this BeanContextChildSupport.
 boolean validatePendingSetBeanContext(BeanContext newValue)
          Called from setBeanContext to validate (or otherwise) the pending change in the nesting BeanContext property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

beanContextChildPeer

public BeanContextChild beanContextChildPeer
The BeanContext in which this BeanContextChild is nested.


pcSupport

protected PropertyChangeSupport pcSupport
The PropertyChangeSupport associated with this BeanContextChildSupport.


vcSupport

protected VetoableChangeSupport vcSupport
The VetoableChangeSupport associated with this BeanContextChildSupport.


beanContext

protected transient BeanContext beanContext

rejectedSetBCOnce

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

Constructor Detail

BeanContextChildSupport

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


BeanContextChildSupport

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

Method Detail

setBeanContext

public void setBeanContext(BeanContext bc)
                    throws PropertyVetoException
Sets the BeanContext for this BeanContextChildSupport.

Specified by:
setBeanContext in interface BeanContextChild
Parameters:
bc - the new value to be assigned to the BeanContext property
Throws:
PropertyVetoException - if the change is rejected
PropertyVetoException

getBeanContext

public BeanContext getBeanContext()
Gets the nesting BeanContext for this BeanContextChildSupport.

Specified by:
getBeanContext in interface BeanContextChild
Returns:
the nesting BeanContext for this BeanContextChildSupport.

addPropertyChangeListener

public void addPropertyChangeListener(String name,
                                      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.

Specified by:
addPropertyChangeListener in interface BeanContextChild
Parameters:
name - The name of the property to listen on
pcl - The PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(String name,
                                         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.

Specified by:
removePropertyChangeListener in interface BeanContextChild
Parameters:
name - The name of the property that was listened on
pcl - The PropertyChangeListener to be removed

addVetoableChangeListener

public void addVetoableChangeListener(String name,
                                      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.

Specified by:
addVetoableChangeListener in interface BeanContextChild
Parameters:
name - The name of the property to listen on
vcl - The VetoableChangeListener to be added

removeVetoableChangeListener

public void removeVetoableChangeListener(String name,
                                         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.

Specified by:
removeVetoableChangeListener in interface BeanContextChild
Parameters:
name - The name of the property that was listened on
vcl - The VetoableChangeListener to be removed

serviceRevoked

public void serviceRevoked(BeanContextServiceRevokedEvent bcsre)
A service provided by the nesting BeanContext has been revoked. Subclasses may override this method in order to implement their own behaviors.

Specified by:
serviceRevoked in interface BeanContextServiceRevokedListener
Parameters:
bcsre - The BeanContextServiceRevokedEvent fired as a result of a service being revoked

serviceAvailable

public void serviceAvailable(BeanContextServiceAvailableEvent bcsae)
A new service is available from the nesting BeanContext. Subclasses may override this method in order to implement their own behaviors

Specified by:
serviceAvailable in interface BeanContextServicesListener
Parameters:
bcsae - The BeanContextServiceAvailableEvent fired as a result of a service becoming available

getBeanContextChildPeer

public BeanContextChild getBeanContextChildPeer()
Gets the BeanContextChild associated with this BeanContextChildSupport.

Returns:
the BeanContextChild peer of this class

isDelegated

public boolean isDelegated()
Reports whether or not this class is a delegate of another.

Returns:
true if this class is a delegate of another

firePropertyChange

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 - The programmatic name of the property that was changed
oldValue - The old value of the property
newValue - The new value of the property

fireVetoableChange

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 - 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
Throws:
PropertyVetoException - if the recipient wishes the property change to be rolled back.

validatePendingSetBeanContext

public boolean validatePendingSetBeanContext(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.

Parameters:
newValue - the new value that has been requested for the BeanContext property
Returns:
true if the change operation is to be vetoed

releaseBeanContextResources

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.


initializeBeanContextResources

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.


Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :

Quels sont les motivations de cette démarche?

Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.

Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.

Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.

Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.

Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

7 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-3914
Document créé le 26/09/06 00:36, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-java/beans/beancontext/BeanContextChildSupport.html Document affiché 1 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
0,47 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
Il faut se garder de trois fautes : parler sans y être invité, ce qui est impertinence ; ne pas parler quand on y est invité, ce qui est de la dissimulation ; parler sans observer les réactions de l'autre, ce qui est de l'aveuglement.

Confucius
 
l'infobrol
Nous sommes le Vendredi 01 Juin 2012, 15:07, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)