synapse-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hira...@apache.org
Subject svn commit: r812855 - in /synapse/branches/1.3/modules/core/src: main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java main/java/org/apache/synapse/mediators/base/SequenceMediator.java test/java/org/apache/synapse/TestMessageContext.java
Date Wed, 09 Sep 2009 09:38:58 GMT
Author: hiranya
Date: Wed Sep  9 09:38:57 2009
New Revision: 812855

URL: http://svn.apache.org/viewvc?rev=812855&view=rev
Log:
Modified the Synapse message context implementations to init uninitialized endpoints and sequences
before returning them. Fix for SYNAPSE-577.


Modified:
    synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
    synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
    synapse/branches/1.3/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java

Modified: synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
URL: http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java?rev=812855&r1=812854&r2=812855&view=diff
==============================================================================
--- synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
(original)
+++ synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
Wed Sep  9 09:38:57 2009
@@ -34,6 +34,7 @@
 import org.apache.synapse.Mediator;
 import org.apache.synapse.MessageContext;
 import org.apache.synapse.SynapseConstants;
+import org.apache.synapse.mediators.base.SequenceMediator;
 import org.apache.synapse.config.Entry;
 import org.apache.synapse.config.SynapseConfiguration;
 import org.apache.synapse.core.SynapseEnvironment;
@@ -132,6 +133,9 @@
             return (Mediator) o;
         } else {
             Mediator m = getConfiguration().getSequence(key);
+            if (m instanceof SequenceMediator && !((SequenceMediator) m).isInitialized())
{
+                ((SequenceMediator) m).init(synEnv);
+            }
             localEntries.put(key, m);
             return m;
         }
@@ -143,6 +147,9 @@
             return (Endpoint) o;
         } else {
             Endpoint e = getConfiguration().getEndpoint(key);
+            if (!e.isInitialized()) {
+                e.init(synEnv);
+            }
             localEntries.put(key, e);
             return e;
         }

Modified: synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
URL: http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java?rev=812855&r1=812854&r2=812855&view=diff
==============================================================================
--- synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
(original)
+++ synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
Wed Sep  9 09:38:57 2009
@@ -285,4 +285,8 @@
     public void setFileName(String fileName) {
         this.fileName = fileName;
     }
+
+    public boolean isInitialized() {
+        return initialized;
+    }
 }

Modified: synapse/branches/1.3/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
URL: http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java?rev=812855&r1=812854&r2=812855&view=diff
==============================================================================
--- synapse/branches/1.3/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
(original)
+++ synapse/branches/1.3/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
Wed Sep  9 09:38:57 2009
@@ -28,6 +28,7 @@
 import org.apache.synapse.config.SynapseConfiguration;
 import org.apache.synapse.core.SynapseEnvironment;
 import org.apache.synapse.endpoints.Endpoint;
+import org.apache.synapse.mediators.base.SequenceMediator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -129,6 +130,9 @@
             return (Mediator) o;
         } else {
             Mediator m = getConfiguration().getSequence(key);
+            if (m instanceof SequenceMediator && !((SequenceMediator) m).isInitialized())
{
+                ((SequenceMediator) m).init(synEnv);
+            }
             localEntries.put(key, m);
             return m;
         }
@@ -140,6 +144,9 @@
             return (Endpoint) o;
         } else {
             Endpoint e = getConfiguration().getEndpoint(key);
+            if (!e.isInitialized()) {
+                e.init(synEnv);
+            }
             localEntries.put(key, e);
             return e;
         }



Mime
View raw message