axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chamik...@apache.org
Subject svn commit: r412751 - in /webservices/axis2/trunk/java/modules/savan/src/org/apache/savan: SavanConstants.java eventing/EventingPublicationProcessor.java eventing/EventingSubscriber.java publication/PublicationProcessor.java
Date Thu, 08 Jun 2006 13:42:15 GMT
Author: chamikara
Date: Thu Jun  8 06:42:15 2006
New Revision: 412751

URL: http://svn.apache.org/viewvc?rev=412751&view=rev
Log:
Changed the Eventing Processor to fully build the SOAP envelope before sending. Otherwise
OM may fail when sending the same envelope to several listners.
Changed the Eventing Subscriber to send full published SOAP envelope (using an OperationClient).

Modified:
    webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/SavanConstants.java
    webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingPublicationProcessor.java
    webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingSubscriber.java
    webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/publication/PublicationProcessor.java

Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/SavanConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/SavanConstants.java?rev=412751&r1=412750&r2=412751&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/SavanConstants.java (original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/SavanConstants.java Thu
Jun  8 06:42:15 2006
@@ -43,4 +43,5 @@
 	}
 	
 	String SUBSCRIBER_TABLE = "SUBSCRIBER_TABLE";
+	
 }

Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingPublicationProcessor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingPublicationProcessor.java?rev=412751&r1=412750&r2=412751&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingPublicationProcessor.java
(original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingPublicationProcessor.java
Thu Jun  8 06:42:15 2006
@@ -23,8 +23,12 @@
 
 public class EventingPublicationProcessor extends PublicationProcessor {
 
-	public void updatePublication() {
-		//TODO update the publication as necessary.
+	public void updatePublication(SavanMessageContext messageToBeNotified) {
+		
+		//soap envelope has to be built before sending to multiple clients.
+		if (messageToBeNotified.getEnvelope()!=null)
+			messageToBeNotified.getEnvelope().build();
+		
 	}
 
 	

Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingSubscriber.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingSubscriber.java?rev=412751&r1=412750&r2=412751&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingSubscriber.java
(original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/eventing/EventingSubscriber.java
Thu Jun  8 06:42:15 2006
@@ -19,14 +19,14 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.OperationClient;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.MessageContext;
 import org.apache.savan.SavanException;
 import org.apache.savan.SavanMessageContext;
 import org.apache.savan.subscribers.LeafSubscriber;
 
-
-
 public class EventingSubscriber extends LeafSubscriber {
 
 	private EndpointReference endToEPr;
@@ -65,12 +65,21 @@
 		
 		try {
 			ServiceClient sc = new ServiceClient (null,null);
-			Options options = new Options ();
-			options.setTo(deliveryEPR);
+			
+			Options options = notificationMessage.getMessageContext().getOptions();
+			if (options==null) {
+				options = new Options ();
+			}
+			
 			sc.setOptions(options);
 			
-			//TODO correct this to send the complete envelope.
-			sc.fireAndForget (notificationMessage.getEnvelope().getBody().getFirstElement());
+			options.setTo(deliveryEPR);
+			
+			MessageContext mc = new MessageContext ();
+			mc.setEnvelope(notificationMessage.getEnvelope());
+			OperationClient client = sc.createClient(ServiceClient.ANON_OUT_ONLY_OP);
+			client.addMessageContext(mc);
+			client.execute(true);
 			
 		} catch (AxisFault e) {
 			throw new SavanException (e);

Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/publication/PublicationProcessor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/publication/PublicationProcessor.java?rev=412751&r1=412750&r2=412751&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/publication/PublicationProcessor.java
(original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/publication/PublicationProcessor.java
Thu Jun  8 06:42:15 2006
@@ -17,7 +17,6 @@
 
 package org.apache.savan.publication;
 
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 
@@ -36,7 +35,7 @@
 		
 		PublicationErrorReport report = new PublicationErrorReport ();
 		
-		updatePublication ();
+		updatePublication (messageToBeNotified);
 		
 		for (Iterator it=subscribers.keySet().iterator();it.hasNext();) {
 			Subscriber subscriber = (Subscriber) subscribers.get(it.next());
@@ -52,5 +51,5 @@
 		return report;
 	}
 	
-	public abstract void updatePublication ();
+	public abstract void updatePublication (SavanMessageContext messageToBeNotified);
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message