synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ind...@apache.org
Subject svn commit: r569252 - in /webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse: SynapseServer.java mediators/GetPropertyFunction.java mediators/transform/HeaderMediator.java
Date Fri, 24 Aug 2007 05:25:22 GMT
Author: indika
Date: Thu Aug 23 22:25:21 2007
New Revision: 569252

URL: http://svn.apache.org/viewvc?rev=569252&view=rev
Log:
some minor improvements

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java?rev=569252&r1=569251&r2=569252&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java
Thu Aug 23 22:25:21 2007
@@ -51,8 +51,7 @@
     }
 
     private static void addShutdownHook() {
-        Thread shutdownHook;
-        shutdownHook = new Thread() {
+        Thread shutdownHook = new Thread() {
             public void run() {
                 log.info("Shutting down Apache Synapse ...");
                 try {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java?rev=569252&r1=569251&r2=569252&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
Thu Aug 23 22:25:21 2007
@@ -19,6 +19,7 @@
 
 package org.apache.synapse.mediators;
 
+import org.apache.axis2.addressing.EndpointReference;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.Constants;
@@ -119,27 +120,44 @@
         }
         if (Constants.SCOPE_DEFAULT.equals(scope)) {
 
-            if (Constants.HEADER_TO.equals(key) && synCtx.getTo() != null) {
-                return synCtx.getTo().getAddress();
-            } else if (Constants.HEADER_FROM.equals(key) && synCtx.getFrom() != null)
{
-                return synCtx.getFrom().getAddress();
-            } else if (Constants.HEADER_ACTION.equals(key) && synCtx.getWSAAction()
!= null) {
-                return synCtx.getWSAAction();
-            } else if (Constants.HEADER_FAULT.equals(key) && synCtx.getFaultTo()
!= null) {
-                return synCtx.getFaultTo().getAddress();
-            } else if (Constants.HEADER_REPLY_TO.equals(key) && synCtx.getReplyTo()
!= null) {
-                return synCtx.getReplyTo().getAddress();
-            } else if (Constants.HEADER_MESSAGE_ID.equals(key) && synCtx.getMessageID()
!= null) {
-                return synCtx.getMessageID();
+            if (Constants.HEADER_TO.equals(key)) {
+                EndpointReference toEPR = synCtx.getTo();
+                if (toEPR != null) {
+                    return toEPR.getAddress();
+                }
+            } else if (Constants.HEADER_FROM.equals(key)) {
+                EndpointReference fromEPR = synCtx.getFrom();
+                if (fromEPR != null) {
+                    return fromEPR.getAddress();
+                }
+            } else if (Constants.HEADER_ACTION.equals(key)) {
+                String wsaAction = synCtx.getWSAAction();
+                if (wsaAction != null) {
+                    return wsaAction;
+                }
+            } else if (Constants.HEADER_FAULT.equals(key)) {
+                EndpointReference faultEPR = synCtx.getFaultTo();
+                if (faultEPR != null) {
+                    return faultEPR.getAddress();
+                }
+            } else if (Constants.HEADER_REPLY_TO.equals(key)) {
+                EndpointReference replyToEPR = synCtx.getReplyTo();
+                if (replyToEPR != null) {
+                    return replyToEPR.getAddress();
+                }
+            } else if (Constants.HEADER_MESSAGE_ID.equals(key)) {
+                String messageID = synCtx.getMessageID();
+                if (messageID != null) {
+                    return messageID;
+                }
             } else {
                 Object result = synCtx.getProperty(key);
                 if (result != null) {
                     return result;
                 } else {
-                    return synCtx.getEntry(key);       
+                    return synCtx.getEntry(key);
                 }
             }
-
         } else if (Constants.SCOPE_AXIS2.equals(scope) && synCtx instanceof Axis2MessageContext)
{
             org.apache.axis2.context.MessageContext axis2MessageContext
                     = ((Axis2MessageContext) synCtx).getAxis2MessageContext();

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java?rev=569252&r1=569251&r2=569252&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
Thu Aug 23 22:25:21 2007
@@ -84,7 +84,7 @@
         }
         if (action == ACTION_SET) {
             String value = (getValue() != null ? getValue() :
-                    Axis2MessageContext.getStringValue(getExpression(), synCtx));
+                    Axis2MessageContext.getStringValue(expression, synCtx));
             if (log.isDebugEnabled()) {
                 log.debug("Setting header : " + qName + " to : " + value);
             }



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


Mime
View raw message