net.sf.doolin.bus.bean
Class Bean

java.lang.Object
  extended by net.sf.doolin.bus.bean.Bean
All Implemented Interfaces:
Serializable, IBean
Direct Known Subclasses:
AbstractActionContext, AbstractFieldDescriptor, AbstractGUIEdit, BusMonitoringLog, BusMonitoringModel, Column, SelectableItem, SystemInformationModel, ValidationSupportImpl, Value, WizardState

public abstract class Bean
extends Object
implements Serializable, IBean

This class defines an object that can notify its changes to the bus.

Notification of changes can be done on the spot, or buffered or completely stopped.

Any Bean can have a parent and we can therefore define a hierarchy of beans. Each level in the hierarchy participates in the notification of changes.

For example, in the following hierarchy:

 A {
        B b;
 }

 B {
        C c;
 }

 C {
        String name;
 }
 

If C notifies a change on name as in:

 C {
        ...
        notify("name", "Old value", "A new name");
        ...
 }
 

Following events are generated on the bus:

 C.name := "A new name";
 B.c.name := "A new name";
 A.b.c.name := "A new name";
 

Author:
Damien Coraboeuf
See Also:
Serialized Form

Constructor Summary
Bean()
           
 
Method Summary
 BeanNotificationSupport getBeanNotificationSupport()
           
 IParentBean getParentBean()
           
protected  void notify(String propertyName, Object oldValue, Object newValue)
          Notifies to the bus that a simple property (non-Bean) has changed.
 void setParentBean(IParentBean parentBean)
          Sets the parent bean for this bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bean

public Bean()
Method Detail

getBeanNotificationSupport

public BeanNotificationSupport getBeanNotificationSupport()
Specified by:
getBeanNotificationSupport in interface IBean

getParentBean

public IParentBean getParentBean()
Specified by:
getParentBean in interface IBean

notify

protected void notify(String propertyName,
                      Object oldValue,
                      Object newValue)
Notifies to the bus that a simple property (non-Bean) has changed. If the notification mode is BUFFERED, the change will be actually sent when notification mode is restored to NORMAL.

Parameters:
propertyName - Name of the property
oldValue - Old value of the property
newValue - New value of the property
See Also:
PropertyChangeMessage

setParentBean

public void setParentBean(IParentBean parentBean)
Sets the parent bean for this bean.

Specified by:
setParentBean in interface IBean
Parameters:
parentBean - New parent bean


Copyright © 2011. All Rights Reserved.