Thanks, I will update this page in the docs. The WSRP impl uses the 
results of getResourceProperty() (and the values presented in 
setResourceProperties()) to fill in the propertyChanged() parameters. 
Assuming you are provided two POJOs with the old/new values, you could 
create Element fragments like so:

Element oldXML = XmlUtils.createElement(name, oldValue);
Element newXML = XmlUtils.createElement(name, newValue);


Dan



"José Antonio Sánchez" <[EMAIL PROTECTED]> wrote on 12/12/2006 10:33:52 
AM:

> Hello, some documentation is outdated for Muse 2.1. Specially, I'm
> trying to send a Notification upon a property change outside of a
> SetResourceProperties request. According to the documentation in
> 
http://ws.apache.org/muse/docs/2.1.0/manual/how-to/publish-wsrp-notifications.html
> the code I must write is:
> 
> import org.apache.muse.ws.resource.properties.*;
> import org.apache.muse.ws.resource.properties.listeners.*;
> 
> ...
> 
> //
> // in this scenario, we are alerted to a property change
> // that occurred outside of WSRP requests, and that alert
> // presumably contains the name/value pair for the change
> //
> QName name = ...;
> Object oldValue = ...;
> Object newValue = ...;
> 
> ResourcePropertyCollection wsrp = 
getWsResource().getPropertyCollection();
> Iterator i = wsrp.getChangeListeners();
> 
> while (i.hasNext())
> {
>     PropertyChangeListener listener = (PropertyChangeListener)i.next();
>     listener.propertyChanged(name, oldValue, newValue);
> }
> 
> But now:
> 
> - getChangeListeners() expects a QName (I suppose the desired property 
name)·
> - as a result propertyChanged method doesn't need a name in its first
> argument, but it expects two elements (Element classes) as old and new
> values.
> How can I get an Element value from a property? Until now I was using
> the capabilities but now I suppose that I have to get it from the
> resource properties docuent in some way (using DOM interface?)
> 
> -- 
> Saludos.
> José Antonio Sánchez
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to