You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by da...@apache.org on 2007/02/14 17:04:54 UTC
svn commit: r507593 -
/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationProducer.java
Author: danj
Date: Wed Feb 14 08:04:53 2007
New Revision: 507593
URL: http://svn.apache.org/viewvc?view=rev&rev=507593
Log:
Overloaded publish() method so that it can take any POJO and use Serializer to convert it to XML.
Modified:
webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationProducer.java
Modified: webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationProducer.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationProducer.java?view=diff&rev=507593&r1=507592&r2=507593
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationProducer.java (original)
+++ webservices/muse/trunk/modules/muse-wsn-impl/src/org/apache/muse/ws/notification/impl/SimpleNotificationProducer.java Wed Feb 14 08:04:53 2007
@@ -35,6 +35,8 @@
import org.apache.muse.core.ResourceManager;
import org.apache.muse.core.ResourceManagerListener;
import org.apache.muse.core.routing.MessageHandler;
+import org.apache.muse.core.serializer.Serializer;
+import org.apache.muse.core.serializer.SerializerRegistry;
import org.apache.muse.util.LoggingUtils;
import org.apache.muse.util.ReflectUtils;
import org.apache.muse.util.messages.Messages;
@@ -446,6 +448,20 @@
throws SoapFault
{
publish(topicName, content.toXML());
+ }
+
+ public void publish(QName topicName, QName contentName, Object content)
+ throws SoapFault
+ {
+ //
+ // get the right serializer and transform POJO to XML
+ //
+ Class contentType = content.getClass();
+ SerializerRegistry registry = SerializerRegistry.getInstance();
+ Serializer ser = registry.getSerializer(contentType);
+ Element contentXML = ser.toXML(content, contentName);
+
+ publish(topicName, contentXML);
}
public synchronized void removeSubscription(EndpointReference epr)
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org