You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2006/08/05 06:23:43 UTC

svn commit: r428954 - in /webservices/axis2/trunk/java/modules/savan: ./ conf/ src/org/apache/savan/configuration/ src/org/apache/savan/handlers/ src/org/apache/savan/module/ src/org/apache/savan/subscribers/

Author: chamikara
Date: Fri Aug  4 21:23:35 2006
New Revision: 428954

URL: http://svn.apache.org/viewvc?rev=428954&view=rev
Log:
Updated the module initialization to pass the Module class loader to the Savan Config. Manager. This is to make sure that the savan-config.xml is taken correctly.

Changed out handler Set the REPLACE_ADDRESSING_HEADERS property in the piblication messages. This supports multiple sends of the same Msg Ctx. to get the addressing headers updated correctly.

Changed LeafSubscriber not to throw exceptions for expired messages.

Modified:
    webservices/axis2/trunk/java/modules/savan/conf/module.xml
    webservices/axis2/trunk/java/modules/savan/maven.xml
    webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/configuration/ConfigurationManager.java
    webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/handlers/SavanOutHandler.java
    webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/module/SavanModule.java
    webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/subscribers/LeafSubscriber.java

Modified: webservices/axis2/trunk/java/modules/savan/conf/module.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/conf/module.xml?rev=428954&r1=428953&r2=428954&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/conf/module.xml (original)
+++ webservices/axis2/trunk/java/modules/savan/conf/module.xml Fri Aug  4 21:23:35 2006
@@ -2,13 +2,13 @@
 
     <inflow>
         <handler name="SavanInHandler" class="org.apache.savan.handlers.SavanInHandler">
-            <order phase="OpPhase"/>
+            <order phase="OperationInPhase"/>
         </handler>
     </inflow>
     
     <outflow>
         <handler name="SavanOutHandler" class="org.apache.savan.handlers.SavanOutHandler">
-            <order phase="OpPhase"/>
+            <order phase="OperationOutPhase"/>
         </handler>
     </outflow>
 

Modified: webservices/axis2/trunk/java/modules/savan/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/maven.xml?rev=428954&r1=428953&r2=428954&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/savan/maven.xml Fri Aug  4 21:23:35 2006
@@ -13,9 +13,11 @@
 
         <mkdir dir="target/classes/META-INF"/>
         <copy file="conf/module.xml"
-            tofile="target/classes/META-INF/module.xml"/>
+            toDir="target/classes/META-INF/"/>
+	  <copy file="conf/savan-config.xml"
+            toDir="target/classes/"/>
         <copy file="../../LICENSE.txt"
-            tofile="target/classes/META-INF/LICENSE.txt" overwrite="true"/>
+            toDir="target/classes/META-INF/" overwrite="true"/>
         <mkdir dir="target/modules"/>
         
         <jar jarfile="target/savan-${savan_version}.mar" basedir="target/classes">
@@ -29,9 +31,11 @@
     
         <mkdir dir="target/classes/META-INF"/>
         <copy file="conf/module.xml"
-            tofile="target/classes/META-INF/module.xml"/>
+            toDir="target/classes/META-INF/"/>
         <copy file="../../LICENSE.txt"
-            tofile="target/classes/META-INF/LICENSE.txt" overwrite="true"/>
+            toDir="target/classes/META-INF/" overwrite="true"/>
+	  <copy file="conf/savan-config.xml"
+            toDir="target/classes/"/>
         <mkdir dir="target/modules"/>
         
         <jar jarfile="target/savan-${savan_version}.mar" basedir="target/classes">

Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/configuration/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/configuration/ConfigurationManager.java?rev=428954&r1=428953&r2=428954&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/configuration/ConfigurationManager.java (original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/configuration/ConfigurationManager.java Fri Aug  4 21:23:35 2006
@@ -88,9 +88,13 @@
 	 * @throws SavanException
 	 */
 	public void configure () throws SavanException {
-		System.out.println("new");
-		InputStream in = getClass().getClassLoader().
-					getResourceAsStream(SavanConstants.CONFIG_FILE);
+		ClassLoader classLoader = getClass().getClassLoader();
+
+		configure(classLoader);
+	}
+	
+	public void configure (ClassLoader classLoader) throws SavanException {
+		InputStream in = classLoader.getResourceAsStream(SavanConstants.CONFIG_FILE);
 
 		if (in==null)
 			throw new SavanException ("Cannot find the savan configuration file. Initialation cannot continue.");

Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/handlers/SavanOutHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/handlers/SavanOutHandler.java?rev=428954&r1=428953&r2=428954&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/handlers/SavanOutHandler.java (original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/handlers/SavanOutHandler.java Fri Aug  4 21:23:35 2006
@@ -19,6 +19,7 @@
 import java.util.Iterator;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.handlers.AbstractHandler;
 import org.apache.commons.logging.Log;
@@ -54,6 +55,10 @@
 				
 				//building the publication envelope
 				msgContext.getEnvelope().build();
+				
+				//this tell addressing to polulate the SOAP envelope with the new values set in the options object
+				//(i.e. by removing old headers) every time the message sent through it.
+				msgContext.setProperty(AddressingConstants.REPLACE_ADDRESSING_HEADERS, new Boolean (true));
 				
 				PublicationReport report = new PublicationReport();
 				Iterator iterator = store.retrieveAll();

Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/module/SavanModule.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/module/SavanModule.java?rev=428954&r1=428953&r2=428954&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/module/SavanModule.java (original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/module/SavanModule.java Fri Aug  4 21:23:35 2006
@@ -53,7 +53,8 @@
 	public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault {
 		ConfigurationManager configurationManager = new ConfigurationManager ();
 		try {
-			configurationManager.configure();
+			ClassLoader moduleClassLoader = module.getModuleClassLoader();
+			configurationManager.configure(moduleClassLoader);
 		} catch (SavanException e) {
 			log.error ("Exception thrown while trying to configure the Savan module",e);
 		}

Modified: webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/subscribers/LeafSubscriber.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/subscribers/LeafSubscriber.java?rev=428954&r1=428953&r2=428954&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/subscribers/LeafSubscriber.java (original)
+++ webservices/axis2/trunk/java/modules/savan/src/org/apache/savan/subscribers/LeafSubscriber.java Fri Aug  4 21:23:35 2006
@@ -20,8 +20,11 @@
 import java.util.Calendar;
 import java.util.Date;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.savan.SavanException;
 import org.apache.savan.SavanMessageContext;
+import org.apache.savan.module.SavanModule;
 import org.apache.savan.publication.PublicationReport;
 import org.apache.savan.subscription.ExpirationBean;
 import org.apache.savan.util.CommonUtil;
@@ -32,6 +35,8 @@
  */
 public abstract class LeafSubscriber extends AbstractSubscriber {
 	
+	private static final Log log = LogFactory.getLog(LeafSubscriber.class);
+	
 	/**
 	 * The time at which further notification of messages should be avaoded
 	 * to this subscriber.
@@ -71,7 +76,10 @@
 		
 		if (expired) {
 			String message = "Cant notify the listner since the subscription has been expired";
-			throw new SavanException (message);
+			log.debug(message);
+			
+			//TODO inform in some other manner than sending an exception.
+//			throw new SavanException (message);
 		}
 		
 		doProtocolSpecificPublication (publication);



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