org.apache.muse.ws.notification.properties
Class ChangeNotificationListener

java.lang.Object
  extended by org.apache.muse.ws.notification.properties.ChangeNotificationListener
All Implemented Interfaces:
PropertyChangeListener

public class ChangeNotificationListener
extends Object
implements PropertyChangeListener

ChangeNotificationListener is a PropertyChangeListener that reports changes in a resource property to the WS-N topic that represents the property. The WS-N notification message create by this listener have a ResourcePropertyValueChangeNotification content item. That content contains the old and new values of the property.

Note that this class does not send the notification messages directly - that is handled by the WS-N NotificationProducer component.

Author:
Dan Jemiolo (danj)
See Also:
WsrpNotificationListenerFactory

Constructor Summary
ChangeNotificationListener(QName topicName, NotificationProducer wsn)
           
 
Method Summary
protected  NotificationProducer getNotificationProducer()
           
 QName getPropertyName()
           
 void propertyChanged(Element oldValue, Element newValue)
          Creates a WS-N message that holds a WS-RP change notification event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeNotificationListener

public ChangeNotificationListener(QName topicName,
                                  NotificationProducer wsn)
Method Detail

getNotificationProducer

protected NotificationProducer getNotificationProducer()

getPropertyName

public QName getPropertyName()
Specified by:
getPropertyName in interface PropertyChangeListener
Returns:
The QName of the property to monitor.

propertyChanged

public void propertyChanged(Element oldValue,
                            Element newValue)
                     throws BaseFault
Creates a WS-N message that holds a WS-RP change notification event. The format of this event is the one recommended by the WS-RP spec for integrating with WS-N; it has a root element named ResourcePropertyValueChangeNotification that wraps two child elements: the old value and the new value. Once the message is created, it is set as the current message for the property's WS-N SimpleTopic.

This method does not actually send out any notifications. The WS-N framework will send out the message in the proper format if there are any subscribers to the property's topic at the time of the change.

Specified by:
propertyChanged in interface PropertyChangeListener
Parameters:
oldValue - A copy of the property instance before it was changed.
newValue - The current value of the property instance.
Throws:
BaseFault -
  • If the change reaction fails for any reason.


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.