net.sf.doolin.bus.support
Class PropertyChangeSubscriber

java.lang.Object
  extended by net.sf.doolin.bus.support.AbstractSubscriber<PropertyChangeMessage>
      extended by net.sf.doolin.bus.support.PropertyChangeSubscriber
All Implemented Interfaces:
Subscriber<PropertyChangeMessage>, SubscriberExecution<PropertyChangeMessage>, SubscriberTrigger<PropertyChangeMessage>, SubscriberValidator

public class PropertyChangeSubscriber
extends AbstractSubscriber<PropertyChangeMessage>

This subscriber listens to property changes on a particular bean.

Author:
Damien Coraboeuf

Constructor Summary
PropertyChangeSubscriber(String executionDescription, SubscriberValidator validator, Object bean, String propertyName, PropertyChangeListener propertyChangeListener)
          Constructor
 
Method Summary
 boolean accept(PropertyChangeMessage message)
          Checks the message
 String getExecutionDescription()
          Describes the execution.
 String getTriggerDescription()
          Description for the trigger
 void receive(PropertyChangeMessage message)
          This method called whenever a message is received.
 
Methods inherited from class net.sf.doolin.bus.support.AbstractSubscriber
getMessageClass, getValidatorDescription, isValid, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyChangeSubscriber

public PropertyChangeSubscriber(String executionDescription,
                                SubscriberValidator validator,
                                Object bean,
                                String propertyName,
                                PropertyChangeListener propertyChangeListener)
Constructor

Parameters:
executionDescription - Description of the action that is performed by this subscriber
validator - Subscription validator
bean - Bean to listen to
propertyName - Property path to listen to or null if all properties must be listened to
propertyChangeListener - Listener for the changes
Method Detail

accept

public boolean accept(PropertyChangeMessage message)
Description copied from interface: SubscriberTrigger
Checks the message


getExecutionDescription

public String getExecutionDescription()
Description copied from interface: SubscriberExecution
Describes the execution. This information is used for debugging purpose only.

Returns:
A description of the execution.

getTriggerDescription

public String getTriggerDescription()
Description copied from interface: SubscriberTrigger
Description for the trigger


receive

public void receive(PropertyChangeMessage message)
Description copied from interface: SubscriberExecution
This method called whenever a message is received.

Parameters:
message - Message to handle


Copyright © 2011. All Rights Reserved.