synapse-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hira...@apache.org
Subject svn commit: r812856 - in /synapse/trunk/java/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:45:33 GMT
Author: hiranya
Date: Wed Sep  9 09:45:33 2009
New Revision: 812856

URL: http://svn.apache.org/viewvc?rev=812856&view=rev
Log:
Fixing SYNAPSE-577. CHanged message ctx implementations to init uninitialized endpoints and
sequences before returning them.


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

Modified: synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java?rev=812856&r1=812855&r2=812856&view=diff
==============================================================================
--- synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
(original)
+++ synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
Wed Sep  9 09:45:33 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/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java?rev=812856&r1=812855&r2=812856&view=diff
==============================================================================
--- synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
(original)
+++ synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
Wed Sep  9 09:45:33 2009
@@ -285,4 +285,8 @@
     public void setFileName(String fileName) {
         this.fileName = fileName;
     }
+
+    public boolean isInitialized() {
+        return initialized;
+    }
 }

Modified: synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java?rev=812856&r1=812855&r2=812856&view=diff
==============================================================================
--- synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
(original)
+++ synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
Wed Sep  9 09:45:33 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