synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ind...@apache.org
Subject svn commit: r556522 [1/2] - in /webservices/synapse/trunk/java/modules: core/src/main/java/org/apache/synapse/config/xml/ core/src/main/java/org/apache/synapse/core/axis2/ core/src/main/java/org/apache/synapse/mediators/ core/src/main/java/org/apache/s...
Date Mon, 16 Jul 2007 06:43:53 GMT
Author: indika
Date: Sun Jul 15 23:43:50 2007
New Revision: 556522

URL: http://svn.apache.org/viewvc?view=rev&rev=556522
Log:
put a check condition (log.isDebugEnable())  before log debug messages
fixed some NFE 
improve trace ,log,comments

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchCase.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2SynapseEnvironment.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/DynamicAxisOperation.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseModule.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/AbstractListMediator.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/MediatorFaultHandler.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SynapseMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/DropMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/LogMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/PropertyMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/RMSequenceMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/SendMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/ValidateMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ext/ClassMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/FilterMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/InMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/OutMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/SwitchMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/AbstractRegistry.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/attachment/AttachmentConverter.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/attachment/AttachmentMediator.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/spring/SpringMediator.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java Sun Jul 15 23:43:50 2007
@@ -131,7 +131,9 @@
             MediatorFactory mf = (MediatorFactory) it.next();
             QName tag = mf.getTagQName();
             factoryMap.put(tag, mf.getClass());
-            log.debug("Added MediatorFactory " + mf.getClass() + " to handle " + tag);
+            if (log.isDebugEnabled()) {
+                log.debug("Added MediatorFactory " + mf.getClass() + " to handle " + tag);
+            }
         }
     }
 
@@ -152,13 +154,17 @@
         } else {
             qName = new QName(localName);
         }
-        log.debug("getMediator(" + qName + ")");
+        if (log.isDebugEnabled()) {
+            log.debug("getMediator(" + qName + ")");
+        }
         Class cls = (Class) factoryMap.get(qName);
 
         if (cls == null && localName.indexOf('.') > -1) {
             String newLocalName = localName.substring(0, localName.indexOf('.'));
             qName = new QName(element.getNamespace().getNamespaceURI(), newLocalName);
-            log.debug("getMediator.2(" + qName + ")");
+            if (log.isDebugEnabled()) {
+                log.debug("getMediator.2(" + qName + ")");
+            }
             cls = (Class) factoryMap.get(qName);
         }
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java Sun Jul 15 23:43:50 2007
@@ -96,9 +96,9 @@
      * http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider
      */
     private void registerExtensions() {
-
-        log.debug("Registering mediator extensions found in the classpath : " + System.getProperty("java.class.path"));
-
+        if (log.isDebugEnabled()) {
+            log.debug("Registering mediator extensions found in the classpath : " + System.getProperty("java.class.path"));
+        }
         // register MediatorSerializer extensions
         Iterator it = Service.providers(MediatorSerializer.class);
         while (it.hasNext()) {
@@ -111,7 +111,9 @@
             } catch (IllegalAccessException e) {
                 handleException("Error instantiating mediator serializer : " + ms);
             }
-            log.debug("Added MediatorSerializer " + ms.getClass().getName() + " to handle " + name);
+            if (log.isDebugEnabled()) {
+                log.debug("Added MediatorSerializer " + ms.getClass().getName() + " to handle " + name);
+            }
         }
     }
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchCase.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchCase.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchCase.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchCase.java Sun Jul 15 23:43:50 2007
@@ -105,7 +105,9 @@
             return false;
         }
         boolean retVal = matcher.matches();
-        log.debug("Case : " + regex.pattern() + " evaluated to : " + retVal);
+        if (log.isDebugEnabled()) {
+            log.debug("Case : " + regex.pattern() + " evaluated to : " + retVal);
+        }
         return retVal;
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2FlexibleMEPClient.java Sun Jul 15 23:43:50 2007
@@ -53,9 +53,7 @@
 import org.apache.neethi.PolicyEngine;
 import org.apache.synapse.Constants;
 import org.apache.synapse.SynapseException;
-import org.apache.synapse.statistics.impl.EndPointStatisticsStack;
 import org.apache.synapse.endpoints.utils.EndpointDefinition;
-import org.apache.rampart.handler.WSSHandlerConstants;
 import org.apache.sandesha2.client.SandeshaClientConstants;
 
 /**

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java Sun Jul 15 23:43:50 2007
@@ -178,7 +178,7 @@
 
     /**
      * Constructor for the Axis2MessageContext inside Synapse
-     * 
+     *
      * @param axisMsgCtx MessageContext representing the relevant Axis MC
      * @param synCfg SynapseConfiguraion describing Synapse
      * @param synEnv SynapseEnvironment describing the environment of Synapse
@@ -455,21 +455,17 @@
         if (getMessageID() != null)
             sb.append(separator + "MessageID: " + getMessageID());
 
-
-        SOAPHeader headers = getEnvelope().getHeader();
-        if (headers != null) {
-            Iterator iter = headers.examineAllHeaderBlocks();
-            if (iter.hasNext()) {
-                sb.append(separator + "Headers : ");
-                while (iter.hasNext()) {
-                    Object o = iter.next();
-                    if (o instanceof SOAPHeaderBlock) {
-                        SOAPHeaderBlock header = (SOAPHeaderBlock) o;
-                        sb.append(separator + header.getLocalName() + " : " + header.getText());
-                    } else if (o instanceof OMElement) {
-                        OMElement headerElem = (OMElement) o;
-                        sb.append(separator + headerElem.getLocalName() + " : " + headerElem.getText());
-                    }
+        SOAPHeader soapHeader = getEnvelope().getHeader();
+        if (soapHeader != null) {
+            sb.append(separator + "Headers : ");
+            for (Iterator iter = soapHeader.examineAllHeaderBlocks(); iter.hasNext();) {
+                Object o = iter.next();
+                if (o instanceof SOAPHeaderBlock) {
+                    SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) o;
+                    sb.append(separator + headerBlock.getLocalName() + " : " + headerBlock.getText());
+                } else if (o instanceof OMElement) {
+                    OMElement headerElem = (OMElement) o;
+                    sb.append(separator + headerElem.getLocalName() + " : " + headerElem.getText());
                 }
             }
         }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2SynapseEnvironment.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2SynapseEnvironment.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2SynapseEnvironment.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2SynapseEnvironment.java Sun Jul 15 23:43:50 2007
@@ -74,9 +74,11 @@
                 Mediator outSequence = synCtx.getSequence(sequenceName);
 
                 if (outSequence != null) {
-                    log.debug("Using the sequence named " + sequenceName
-                            + " for the outgoing message mediation of the proxy service "
-                            + synCtx.getProperty(Constants.PROXY_SERVICE));
+                    if (log.isDebugEnabled()) {
+                        log.debug("Using the sequence named " + sequenceName
+                                + " for the outgoing message mediation of the proxy service "
+                                + synCtx.getProperty(Constants.PROXY_SERVICE));
+                    }
                     outSequence.mediate(synCtx);
                 } else {
                     log.error("Unable to find the out-sequence " +
@@ -87,16 +89,18 @@
 
             } else if (synCtx.getConfiguration().getProxyService((String) synCtx.getProperty(
                     Constants.PROXY_SERVICE)).getTargetInLineOutSequence() != null) {
-
-                log.debug("Using the anonymous out-sequence specified in the proxy service "
-                        + synCtx.getProperty(Constants.PROXY_SERVICE)
-                        + " for outgoing message mediation");
+                if (log.isDebugEnabled()) {
+                    log.debug("Using the anonymous out-sequence specified in the proxy service "
+                            + synCtx.getProperty(Constants.PROXY_SERVICE)
+                            + " for outgoing message mediation");
+                }
                 synCtx.getConfiguration().getProxyService((String) synCtx.getProperty(
                         Constants.PROXY_SERVICE)).getTargetInLineOutSequence().mediate(synCtx);
             } else {
-
-                log.debug("Proxy service " + synCtx.getProperty(Constants.PROXY_SERVICE)
-                        + " does not specifies an out-sequence - sending the response back");
+                if (log.isDebugEnabled()) {
+                    log.debug("Proxy service " + synCtx.getProperty(Constants.PROXY_SERVICE)
+                            + " does not specifies an out-sequence - sending the response back");
+                }
                 Axis2Sender.sendBack(synCtx);
             }
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/DynamicAxisOperation.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/DynamicAxisOperation.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/DynamicAxisOperation.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/DynamicAxisOperation.java Sun Jul 15 23:43:50 2007
@@ -24,7 +24,6 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.util.TargetResolver;
 import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.client.OperationClient;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.async.Callback;
@@ -157,7 +156,7 @@
 				// if dont do this , this guy will wait till its gets HTTP 202
 				// in the case
 				// HTTP
-				outMsgCtx.setProperty(MessageContext.TRANSPORT_NON_BLOCKING,
+				outMsgCtx.addFeature(MessageContext.TRANSPORT_NON_BLOCKING,
 						Boolean.TRUE);
 				AxisEngine engine = new AxisEngine(cfgCtx);
 				outMsgCtx.getConfigurationContext().registerOperationContext(

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java Sun Jul 15 23:43:50 2007
@@ -85,8 +85,10 @@
 
                     Mediator faultSequence = synCtx.getSequence(proxy.getTargetFaultSequence());
                     if (faultSequence != null) {
-                        log.debug("Setting the fault-sequence of the " +
-                                "proxy service to MessageContext");
+                        if (log.isDebugEnabled()) {
+                            log.debug("Setting the fault-sequence of the " +
+                                    "proxy service to MessageContext");
+                        }
                         synCtx.pushFaultHandler(new MediatorFaultHandler(
                                 synCtx.getSequence(proxy.getTargetFaultSequence())));
                     } else {
@@ -97,7 +99,9 @@
                                 "specified by the name " + proxy.getTargetFaultSequence());
                     }
                 } else if (proxy.getTargetInLineFaultSequence() != null) {
-                    log.debug("Setting the anonymous fault-sequence of the proxy to context");
+                    if (log.isDebugEnabled()) {
+                        log.debug("Setting the anonymous fault-sequence of the proxy to context");
+                    }
                     synCtx.pushFaultHandler(
                             new MediatorFaultHandler(proxy.getTargetInLineFaultSequence()));
                 }
@@ -111,7 +115,9 @@
                         if (shouldTrace) {
                             trace.trace(msg);
                         }
-                        log.debug(msg);
+                        if (log.isDebugEnabled()) {
+                            log.debug(msg);
+                        }
                         inSequence.mediate(synCtx);
                     } else {
 
@@ -126,7 +132,9 @@
                     if (shouldTrace) {
                         trace.trace(msg);
                     }
-                    log.debug(msg);
+                    if (log.isDebugEnabled()) {
+                        log.debug(msg);
+                    }
                     proxy.getTargetInLineInSequence().mediate(synCtx);
                 }
 
@@ -138,7 +146,9 @@
                         if (shouldTrace) {
                             trace.trace(msg);
                         }
-                        log.debug(msg);
+                        if (log.isDebugEnabled()) {
+                            log.debug(msg);
+                        }
                         endpoint.send(synCtx);
                     } else {
 
@@ -153,7 +163,9 @@
                     if (shouldTrace) {
                         trace.trace(msg);
                     }
-                    log.debug(msg);
+                    if (log.isDebugEnabled()) {
+                        log.debug(msg);
+                    }
                     proxy.getTargetInLineEndpoint().send(synCtx);
                 }
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java Sun Jul 15 23:43:50 2007
@@ -136,7 +136,7 @@
             // there can always be only one instance of an Endpoint in the faultStack of a message
             // if the send was successful, so remove it before we proceed any further
             Stack faultStack = synapseOutMsgCtx.getFaultStack();
-            if (!faultStack.isEmpty() && faultStack.peek() instanceof Endpoint) {
+            if (faultStack !=null && !faultStack.isEmpty() && faultStack.peek() instanceof Endpoint) {
                 faultStack.pop();
             }
             if (log.isDebugEnabled()) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseModule.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseModule.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseModule.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseModule.java Sun Jul 15 23:43:50 2007
@@ -107,7 +107,9 @@
         while (iter.hasNext()) {
             ProxyService proxy = (ProxyService) iter.next();
             proxy.buildAxisService(synCfg, axisCfg);
-            log.debug("Deployed Proxy service : " + proxy.getName());
+            if (log.isDebugEnabled()) {
+                log.debug("Deployed Proxy service : " + proxy.getName());
+            }
             if (!proxy.isStartOnLoad()) {
                 proxy.stop(synCfg);
             }
@@ -126,8 +128,10 @@
         String config = System.getProperty(Constants.SYNAPSE_XML);
 
         if (config != null) {
-            log.debug("System property '" + Constants.SYNAPSE_XML +
-                "' specifies synapse configuration as " + config);
+            if (log.isDebugEnabled()) {
+                log.debug("System property '" + Constants.SYNAPSE_XML +
+                        "' specifies synapse configuration as " + config);
+            }
             synapseConfiguration = SynapseConfigurationBuilder.getConfiguration(config);
         } else {
             log.warn("System property '" + Constants.SYNAPSE_XML +

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/AbstractListMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/AbstractListMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/AbstractListMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/AbstractListMediator.java Sun Jul 15 23:43:50 2007
@@ -41,10 +41,11 @@
 
     public boolean mediate(MessageContext synCtx) {
         try {
-            log.debug("Implicit Sequence <" + getType() + "> :: mediate()");
+            if (log.isDebugEnabled()) {
+                log.debug("Implicit Sequence <" + getType() + "> :: mediate()");
+            }
             saveAndSetTraceState(synCtx);
-            Iterator it = mediators.iterator();            
-            while (it.hasNext()) {
+            for (Iterator it = mediators.iterator(); it.hasNext();) {
                 Mediator m = (Mediator) it.next();
                 if (!m.mediate(synCtx)) {
                     return false;

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?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- 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 Sun Jul 15 23:43:50 2007
@@ -65,7 +65,9 @@
 
         int size = args.size();
         if (size == 0) {
-            log.warn("Property key value for lookup was not specified");
+            if (log.isDebugEnabled()) {
+                log.debug("Property key value for lookup was not specified");
+            }
             return null;
         } else if (size == 1) {
             return evaluate(Constants.SCOPE_DEFAULT, args.get(0), context.getNavigator());
@@ -74,7 +76,9 @@
         } else {
             String msg = "Invalid arguments for synapse:get-property(prop-name) 0r  " +
                     "synapse:get-property(scope,prop-name) XPath function ";
-            log.warn(msg);
+            if (log.isDebugEnabled()) {
+                log.debug(msg);
+            }
             throw new FunctionCallException(msg);
         }
     }
@@ -89,8 +93,10 @@
      */
     public Object evaluate(Object scopeObject, Object keyObject, Navigator navigator) {
         if (synCtx == null) {
-            log.warn("Synapse context has not been set for the XPath extension function" +
-                    "'synapse:get-property(prop-name)'");
+            if (log.isDebugEnabled()) {
+                log.debug("Synapse context has not been set for the XPath extension function" +
+                        "'synapse:get-property(prop-name)'");
+            }
             return null;
 
         }
@@ -98,9 +104,11 @@
         String key = StringFunction.evaluate(keyObject, navigator);
 
         if (key == null || "".equals(key)) {
-            log.warn("property-name should be provided when executing " +
-                    "synapse:get-property(scope,prop-name)" +
-                    " or synapse:get-property(prop-name) Xpath function");
+            if (log.isDebugEnabled()) {
+                log.debug("property-name should be provided when executing " +
+                        "synapse:get-property(scope,prop-name)" +
+                        " or synapse:get-property(prop-name) Xpath function");
+            }
             return null;
         }
         if (Constants.SCOPE_DEFAULT.equals(scope)) {
@@ -141,8 +149,10 @@
                 return headersMap.get(key);
             }
         } else {
-            log.warn("Invalid scope : '" + scope + "' has been set for the " +
-                    "synapse:get-property(scope,prop-name) XPath function");
+            if (log.isDebugEnabled()) {
+                log.debug("Invalid scope : '" + scope + "' has been set for the " +
+                        "synapse:get-property(scope,prop-name) XPath function");
+            }
         }
         return null;
     }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/MediatorFaultHandler.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/MediatorFaultHandler.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/MediatorFaultHandler.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/MediatorFaultHandler.java Sun Jul 15 23:43:50 2007
@@ -38,7 +38,7 @@
     private static final Log log = LogFactory.getLog(MediatorFaultHandler.class);
 
     /**
-     * Thsi holds the fault sequence for the mediator fault handler
+     * This holds the fault sequence for the mediator fault handler
      */
     private Mediator faultMediator = null;
 
@@ -60,8 +60,9 @@
      * @see org.apache.synapse.FaultHandler#handleFault(org.apache.synapse.MessageContext)
      */
     public void onFault(MessageContext synCtx) throws SynapseException {
-
-        log.debug("MediatorFaultHandler :: handleFault");
+        if (log.isDebugEnabled()) {
+            log.debug("MediatorFaultHandler :: handleFault");
+        }
         this.faultMediator.mediate(synCtx);
     }
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SequenceMediator.java Sun Jul 15 23:43:50 2007
@@ -46,8 +46,11 @@
 
     private static final Log log = LogFactory.getLog(SequenceMediator.class);
     private static final Log trace = LogFactory.getLog(Constants.TRACE_LOGGER);
+    /** The name of the this sequence */
     private String name = null;
+    /** The local registry key which is used to pick a sequnce definition*/
     private String key = null;
+    /** The name of the error handler which is used to handle error during the mediation */
     private String errorHandler = null;
     /** is this definition dynamic */
     private boolean dynamic = false;
@@ -69,10 +72,14 @@
      * @return as per standard mediator result
      */
     public boolean mediate(MessageContext synCtx) {
-        
-        log.debug("Sequence mediator <" + (name == null ? "anonymous" : name) + "> :: mediate()");
-        
+
+        if (log.isDebugEnabled()) {
+            log.debug("Sequence mediator <" + (name == null ? "anonymous" : name) + "> :: mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
+        if (shouldTrace) {
+            trace.trace("Start : Sequence <" + (name == null ? "anonymous" : name) + ">");
+        }
         if (key == null) {
             // Setting Required property to collect the sequence statistics
             boolean isStatisticsEnable
@@ -85,39 +92,44 @@
                     synCtx.setProperty(Constants.SEQUENCE_STATISTICS_STACK, sequenceStack);
                 }
                 String seqName = (name == null ? Constants.ANONYMOUS_SEQUENCES : name);
-                boolean isFault =synCtx.getEnvelope().getBody().hasFault();
-                sequenceStack.put(seqName,System.currentTimeMillis(),
-                        !synCtx.isResponse(), isStatisticsEnable,isFault);
+                boolean isFault = synCtx.getEnvelope().getBody().hasFault();
+                sequenceStack.put(seqName, System.currentTimeMillis(),
+                        !synCtx.isResponse(), isStatisticsEnable, isFault);
             }
             try {
-                if (shouldTrace) {
-                    trace.trace("Start : Sequence <" + (name == null ? "anonymous" : name) + ">");
-                }
-
+                // The Mediator for handling error which occur during the mediation through this
+                // sequence
+                Mediator errorHandlerMediator = null;
                 // push the errorHandler sequence into the current message as the fault handler
                 if (errorHandler != null) {
-                    log.debug("Setting the onError handler for the sequence");
+                    if (log.isDebugEnabled()) {
+                        log.debug("Setting the onError handler which has named as " +
+                                errorHandler + " for the sequence ");
+                    }
+                    if (shouldTrace) {
+                        trace.trace("Setting the onError handler which has named as " +
+                                errorHandler + " for the sequence ");
+                    }
+                    errorHandlerMediator = synCtx.getSequence(errorHandler);
                     synCtx.pushFaultHandler(
-                        new MediatorFaultHandler(synCtx.getSequence(errorHandler)));
+                            new MediatorFaultHandler(errorHandlerMediator));
                 }
-
-                boolean ret = super.mediate(synCtx);
-
-                // pop our error handler from the fault stack before we exit, if we have pushed it
-                Stack faultStack = synCtx.getFaultStack();
-                if (errorHandler != null && !faultStack.isEmpty()) {
-                    Object o = faultStack.peek();
-                    if (o instanceof MediatorFaultHandler &&
-                        synCtx.getSequence(errorHandler).equals(
-                            ((MediatorFaultHandler) o).getFaultMediator())) {
-                        faultStack.pop();
+                boolean result = super.mediate(synCtx);
+                if (errorHandlerMediator != null) {
+                    // pop our error handler from the fault stack before we exit, if we have pushed it
+                    Stack faultStack = synCtx.getFaultStack();
+                    if (faultStack != null && !faultStack.isEmpty()) {
+                        Object o = faultStack.peek();
+                        if (o instanceof MediatorFaultHandler &&
+                                errorHandlerMediator.equals(
+                                        ((MediatorFaultHandler) o).getFaultMediator())) {
+                            faultStack.pop();
+                        }
                     }
                 }
-
-                return ret;
+                return result;
 
             } finally {
-
                 //If this sequence is finished it's task normally
                 if (isStatisticsEnable) {
                     StatisticsUtils.processSequenceStatistics(synCtx);
@@ -140,6 +152,9 @@
                 if (shouldTrace) {
                     trace.trace("Executing sequence named " + key);
                 }
+                if (log.isDebugEnabled()) {
+                    log.debug("Executing sequence named " + key);
+                }
                 return m.mediate(synCtx);
             }
         }
@@ -151,26 +166,51 @@
         throw new SynapseException(msg);
     }
 
+    /**
+     * To get the name of the sequence
+     * @return the name of the sequence
+     */
     public String getName() {
         return name;
     }
 
+    /**
+     * setting the name of the sequence
+     * @param name the name of the this sequence
+     */
     public void setName(String name) {
         this.name = name;
     }
 
+    /**
+     * To get the key which which is used to fick the sequence definition from the local registry
+     * @return  return the key which is used to fick the sequence definition from the local registry
+     */
     public String getKey() {
         return key;
     }
 
+    /**
+     * To set the local registry key in order to pick the sequence definition
+     * @param key the local registry key
+     */
     public void setKey(String key) {
         this.key = key;
     }
 
+    /**
+     *
+     * @return  Returns the errorhandler sequence name
+     */
     public String getErrorHandler() {
         return errorHandler;
     }
 
+    /**
+     *
+     * @param errorHandler to used handle error will appear during the
+     *        mediation through this sequence
+     */
     public void setErrorHandler(String errorHandler) {
         this.errorHandler = errorHandler;
     }
@@ -187,7 +227,7 @@
     /**
      * To set the statistics enable variable value
      *
-     * @param statisticsEnable
+     * @param statisticsEnable  To indicate statistics collecting state
      */
     public void setStatisticsEnable(int statisticsEnable) {
         this.statisticsEnable = statisticsEnable;
@@ -218,8 +258,8 @@
     }
 
     /**
-     * get the registry key used to load this sequence dynamically
-     * @param registryKey
+     * To get the registry key used to load this sequence dynamically
+     * @param registryKey  returns the registry key which point to this sequence
      */
     public void setRegistryKey(String registryKey) {
         this.registryKey = registryKey;

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SynapseMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SynapseMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SynapseMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/base/SynapseMediator.java Sun Jul 15 23:43:50 2007
@@ -49,24 +49,29 @@
      * @return as per standard mediate() semantics
      */
     public boolean mediate(MessageContext synCtx) {
-        log.debug("Synapse main mediator :: mediate()");
-        if(synCtx.isResponse()) {
-            StatisticsUtils.processAllSequenceStatistics(synCtx);
+
+        if (log.isDebugEnabled()) {
+            log.debug("Synapse main mediator :: mediate()");
         }
-        StatisticsStack sequenceStack = (StatisticsStack) synCtx.getProperty(
-                Constants.SEQUENCE_STATISTICS_STACK);
-        if (sequenceStack == null) {
-            sequenceStack = new SequenceStatisticsStack();
-            synCtx.setProperty(Constants.SEQUENCE_STATISTICS_STACK, sequenceStack);
-        }
-        String seqName = "MainSequence";
-        boolean isFault = synCtx.getEnvelope().getBody().hasFault();
-        sequenceStack.put(seqName, System.currentTimeMillis(), !synCtx.isResponse(), true, isFault);
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
-         try {
+        try {
             if (shouldTrace) {
                 trace.trace("Start : Synapse main mediator");
             }
+            // If the message flow path is OUT, then process the satatistics
+            if (synCtx.isResponse()) {
+                StatisticsUtils.processAllSequenceStatistics(synCtx);
+            }
+            //put the required property for the collecttng statistics for the message mediation
+            StatisticsStack sequenceStack = (StatisticsStack) synCtx.getProperty(
+                    Constants.SEQUENCE_STATISTICS_STACK);
+            if (sequenceStack == null) {
+                sequenceStack = new SequenceStatisticsStack();
+                synCtx.setProperty(Constants.SEQUENCE_STATISTICS_STACK,sequenceStack);
+            }
+            String seqName = "MainSequence";
+            boolean isFault = synCtx.getEnvelope().getBody().hasFault();
+            sequenceStack.put(seqName,System.currentTimeMillis(),!synCtx.isResponse(),true,isFault);
             return super.mediate(synCtx);
         } finally {
             if (shouldTrace) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/DropMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/DropMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/DropMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/DropMediator.java Sun Jul 15 23:43:50 2007
@@ -41,16 +41,19 @@
      * @return false always
      */
     public boolean mediate(MessageContext synCtx) {
-        log.debug("Drop mediator :: mediate()");
+
+        if (log.isDebugEnabled()) {
+            log.debug("Drop mediator :: mediate()");
+        }
+        boolean shouldTrace = shouldTrace(synCtx.getTracingState());
+        if (shouldTrace) {
+            trace.trace("Start : Drop mediator");
+        }
         //If drop mediator is a child of a sequence
         // and if this sequence is a IN or OUT sequence of a proxy service
         StatisticsUtils.processProxyServiceStatistics(synCtx);
         //If this a sequence is not  a IN or OUT sequence of a proxy service
         StatisticsUtils.processAllSequenceStatistics(synCtx);
-        boolean shouldTrace = shouldTrace(synCtx.getTracingState());
-        if (shouldTrace) {
-            trace.trace("Start : Drop mediator");
-        }
         if (synCtx.getTo() == null) {
             if (shouldTrace) {
                 trace.trace("End : Drop mediator");

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/LogMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/LogMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/LogMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/LogMediator.java Sun Jul 15 23:43:50 2007
@@ -45,14 +45,19 @@
 
     private static final Log log = LogFactory.getLog(LogMediator.class);
     private static final Log trace = LogFactory.getLog(Constants.TRACE_LOGGER);
+
+    /** Log levels ,according to the  log level ,the information going to log  will  be changed */
     public static final int CUSTOM = 0;
     public static final int SIMPLE = 1;
     public static final int HEADERS = 2;
     public static final int FULL = 3;
-    public static final String DEFAULT_SEP = ", ";
 
+    /** The default log level has set to SIMPLE */
     private int logLevel = SIMPLE;
+    /** The separator for which used to separate logging information */
+    public static final String DEFAULT_SEP = ", ";
     private String separator = DEFAULT_SEP;
+    /** The holder for the custom properties */
     private List properties = new ArrayList();
 
     /**
@@ -62,13 +67,18 @@
      * @return true always
      */
     public boolean mediate(MessageContext synCtx) {
-        log.debug("Log mediator :: mediate()");
+
+        if (log.isDebugEnabled()) {
+            log.debug("Log mediator :: mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
         if (shouldTrace) {
             trace.trace("Start : Log mediator");
         }
         String logMessage = getLogMessage(synCtx);
-        log.info(logMessage);
+        if (log.isInfoEnabled()) {
+            log.info(logMessage);
+        }
         if (shouldTrace) {
             trace.trace(logMessage);
             trace.trace("End : Log mediator");
@@ -119,17 +129,20 @@
 
     private String getHeadersLogMessage(MessageContext synCtx) {
         StringBuffer sb = new StringBuffer();
-        SOAPHeader header = synCtx.getEnvelope().getHeader();
-        if (header != null) {
-            Iterator iter = header.examineAllHeaderBlocks();
-            while (iter.hasNext()) {
-                Object o = iter.next();
-                if (o instanceof SOAPHeaderBlock) {
-                    SOAPHeaderBlock headerBlk = (SOAPHeaderBlock) o;
-                    sb.append(separator + headerBlk.getLocalName() + " : " + headerBlk.getText());
-                } else if (o instanceof OMElement) {
-                    OMElement headerElem = (OMElement) o;
-                    sb.append(separator + headerElem.getLocalName() + " : " + headerElem.getText());
+        if (synCtx.getEnvelope() != null) {
+            SOAPHeader header = synCtx.getEnvelope().getHeader();
+            if (header != null) {
+                for (Iterator iter = header.examineAllHeaderBlocks(); iter.hasNext();) {
+                    Object o = iter.next();
+                    if (o instanceof SOAPHeaderBlock) {
+                        SOAPHeaderBlock headerBlk = (SOAPHeaderBlock) o;
+                        sb.append(separator + headerBlk.getLocalName() + " : " +
+                                headerBlk.getText());
+                    } else if (o instanceof OMElement) {
+                        OMElement headerElem = (OMElement) o;
+                        sb.append(separator + headerElem.getLocalName() + " : " +
+                                headerElem.getText());
+                    }
                 }
             }
         }
@@ -147,11 +160,11 @@
 
     private void setCustomProperties(StringBuffer sb, MessageContext synCtx) {
         if (properties != null && !properties.isEmpty()) {
-            Iterator iter = properties.iterator();
-            while (iter.hasNext()) {
+            for (Iterator iter = properties.iterator(); iter.hasNext();) {
                 MediatorProperty prop = (MediatorProperty) iter.next();
                 sb.append(separator + prop.getName() + " = " +
-                        (prop.getValue() != null ? prop.getValue() : prop.getEvaluatedExpression(synCtx)));
+                        (prop.getValue() != null ? prop.getValue() :
+                                prop.getEvaluatedExpression(synCtx)));
             }
         }
     }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/PropertyMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/PropertyMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/PropertyMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/PropertyMediator.java Sun Jul 15 23:43:50 2007
@@ -32,9 +32,11 @@
 import java.util.Set;
 
 /**
- * The property mediator would save(or remove) a named property as a local property of the Synapse Message Context
- * or as a property of the Axis2 Message Context or as a Transport Header.
- * Properties set this way could be extracted through the XPath extension function "synapse:get-property(scope,prop-name)"
+ * The property mediator would save(or remove) a named property as a local property of
+ * the Synapse Message Context or as a property of the Axis2 Message Context or
+ * as a Transport Header.
+ * Properties set this way could be extracted through the XPath extension function
+ * "synapse:get-property(scope,prop-name)"
  */
 
 public class PropertyMediator extends AbstractMediator {
@@ -64,21 +66,26 @@
      * @return true always
      */
     public boolean mediate(MessageContext smc) {
-        log.debug("Property mediator :: mediate()");
+        if (log.isDebugEnabled()) {
+            log.debug("Property mediator :: mediate()");
+        }
         boolean shouldTrace = shouldTrace(smc.getTracingState());
         if (shouldTrace) {
             trace.trace("Start : Property mediator");
         }
         if (action == ACTION_SET) {
-            String resultValue = (this.value != null ? this.value : Axis2MessageContext.getStringValue(
-                    expression, smc));
-            log.debug("Setting : " + name +
-                    " property (scope:" + (scope == null ? "default" : scope) + ") = " + resultValue);
+            String resultValue = (this.value != null ? this.value :
+                    Axis2MessageContext.getStringValue(expression, smc));
+            if (log.isDebugEnabled()) {
+                log.debug("Setting : " + name +
+                            " property (scope:" + (scope == null ? "default" : scope) + ") = " +
+                                   resultValue);
+            }
             if (shouldTrace) {
                 trace.trace("Property Name : " + name +
-                        " (scope:" + (scope == null ? "default" : scope) + ") set to " +
-                        (value != null ? " resultValue = " + value :
-                                " result of expression " + expression + " = " + resultValue));
+                              " (scope:" + (scope == null ? "default" : scope) + ") set to " +
+                                  (value != null ? " resultValue = " + value :
+                                      " result of expression " + expression + " = " + resultValue));
             }
             if (scope == null) {
                 //Setting property into the  Synapse Context
@@ -116,13 +123,20 @@
                 }
             } else {
                 String msg = "Unsupported scope : " + scope + " for property mediator";
+                if(shouldTrace){
+                    trace.trace(msg);
+                }
                 handleException(msg);
             }
         } else {
-            log.debug("Removing : " + name +
-                    " property (scope:" + (scope == null ? "default" : scope) + ") ");
-            trace.trace("Remove - Property Name : " + name +
-                    " (scope:" + (scope == null ? "default" : scope) + ")");
+            if (log.isDebugEnabled()) {
+                log.debug("Removing : " + name +
+                        " property (scope:" + (scope == null ? "default" : scope) + ") ");
+            }
+            if (shouldTrace) {
+                trace.trace("Remove - Property Name : " + name +
+                        " (scope:" + (scope == null ? "default" : scope) + ")");
+            }
             if (scope == null) {
                 //Removing property from the  Synapse Context
                 Set pros = smc.getPropertyKeySet();
@@ -163,6 +177,9 @@
 
             } else {
                 String msg = "Unsupported scope : " + scope + " for property mediator";
+                if (shouldTrace) {
+                    trace.trace(msg);
+                }
                 handleException(msg);
             }
         }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/RMSequenceMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/RMSequenceMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/RMSequenceMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/RMSequenceMediator.java Sun Jul 15 23:43:50 2007
@@ -155,7 +155,9 @@
             throw new SynapseException("XPath error : " + e.getMessage());
         }
         if (node == null) {
-            log.debug("XPath expression did not return any node");
+            if (log.isDebugEnabled()) {
+                log.debug("XPath expression did not return any node");
+            }
             throw new SynapseException("XPath expression did not return any node");
         }
         return node.getText();

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/SendMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/SendMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/SendMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/SendMediator.java Sun Jul 15 23:43:50 2007
@@ -52,8 +52,9 @@
      * @return false always as this is a leaf mediator
      */
     public boolean mediate(MessageContext synCtx) {
-        log.debug("Send mediator :: mediate()");
-
+        if (log.isDebugEnabled()) {
+            log.debug("Send mediator :: mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
         try {
             if (shouldTrace) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/ValidateMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/ValidateMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/ValidateMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/ValidateMediator.java Sun Jul 15 23:43:50 2007
@@ -113,7 +113,9 @@
 
     public boolean mediate(MessageContext synCtx) {
 
-        log.debug("ValidateMediator - Validate mediator mediate()");
+        if (log.isDebugEnabled()) {
+            log.debug("ValidateMediator - Validate mediator mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
         if (shouldTrace) {
             trace.trace("Start : Validate mediator");
@@ -172,7 +174,7 @@
                         //reset the errorhandler state
                         errorHandler.setValidationError(false);
                         if (log.isDebugEnabled()) {
-                            log.debug("Error occured during creating new schema ");
+                            log.debug("Error occured during creating a new schema ");
                         }
                     }
                 } catch (SAXNotSupportedException e) {
@@ -209,9 +211,10 @@
         } catch (IOException e) {
             handleException("Error validating " + source + " element" + e.getMessage(), e);
         }
-
-        log.debug("validation of element returned by the XPath expression : " + source +
-                " succeeded against the given schemas and the current message");
+        if (log.isDebugEnabled()) {
+            log.debug("validation of element returned by the XPath expression : " + source +
+                    " succeeded against the given schemas and the current message");
+        }
         if (shouldTrace) {
             trace.trace("End : Validate mediator");
         }
@@ -219,7 +222,7 @@
     }
 
     /**
-     * This class handles validation errors to be used for error reporting
+     * This class handles validation errors to be used for the error reporting
      */
     private class MyErrorHandler extends DefaultHandler {
 
@@ -329,9 +332,9 @@
             explicityFeatures.add(mp);
             factory.setFeature(featureName, isFeatureEnable);             
         } catch (SAXNotSupportedException e) {
-           handleException("Error setting a feature to Schema Factory " + e.getMessage(),e);
+           handleException("Error setting a feature to the Schema Factory " + e.getMessage(),e);
         } catch (SAXNotRecognizedException e) {
-           handleException("Error setting a feature to Schema Factory " + e.getMessage(),e);
+           handleException("Error setting a feature to the Schema Factory " + e.getMessage(),e);
         }
     }
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ext/ClassMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ext/ClassMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ext/ClassMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ext/ClassMediator.java Sun Jul 15 23:43:50 2007
@@ -56,23 +56,32 @@
      */
     public boolean mediate(MessageContext synCtx) {
 
-        log.debug("Class mediator <" + clazz.getName() + ">:: mediate()");
+        if (log.isDebugEnabled()) {
+            log.debug("Class mediator <" + clazz.getName() + ">:: mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
         if (shouldTrace) {
             trace.trace("Start : Class mediator");
         }
-        Mediator m ;
+        Mediator m = null;
         try {
             try {
                 m = (Mediator) clazz.newInstance();
             } catch (Exception e) {
-                String msg = "Error while creating an instance of the specified mediator class : " + clazz.getName();
-                if (shouldTrace)
+                String msg = "Error while creating an instance of the specified mediator class : " +
+                        clazz.getName();
+                if (shouldTrace) {
                     trace.trace(msg);
-                log.error(msg, e);
-                throw new SynapseException(msg, e);
+                }
+                handleException(msg, e);
+            }
+            if (m == null) {
+                if (log.isDebugEnabled()) {
+                    log.debug("The instance of the specified mediator class : \" +\n" +
+                            clazz.getName() + "is null");
+                }
+                return true;
             }
-
             setProperties(m, synCtx, shouldTrace);
             if (shouldTrace) {
                 trace.trace("Executing an instance of the specified class : " + clazz.getName());
@@ -105,7 +114,9 @@
             try {
                 if (value != null) {
                     Method method = m.getClass().getMethod(mName, new Class[]{String.class});
-                    log.debug("Setting property :: invoking method " + mName + "(" + value + ")");
+                    if (log.isDebugEnabled()) {
+                        log.debug("Setting property :: invoking method " + mName + "(" + value + ")");
+                    }
                     if (shouldTrace) {
                         trace.trace("Setting property :: invoking method " + mName + "(" + value + ")");
                     }
@@ -114,13 +125,18 @@
             } catch (Exception e) {
                 String msg = "Error setting property : " + mProp.getName() + " as a String property into class" +
                     " mediator : " + m.getClass() + " : " + e.getMessage();
-                log.error(msg);
+
                 if (shouldTrace) {
                     trace.trace(msg);
                 }
-                throw new SynapseException(msg, e);
+                handleException(msg,e);
             }
         }
+    }
+
+    private void handleException(String msg, Exception e) {
+        log.error(msg, e);
+        throw new SynapseException(msg, e);
     }
 
     public void setClazz(Class clazz) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/FilterMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/FilterMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/FilterMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/FilterMediator.java Sun Jul 15 23:43:50 2007
@@ -50,18 +50,24 @@
      * @return true if filter condition fails. else returns as per List mediator semantics
      */
     public boolean mediate(MessageContext synCtx) {
-        log.debug("Filter mediator mediate()");
 
+        if (log.isDebugEnabled()) {
+            log.debug("Filter mediator mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
         try {
             if (shouldTrace) {
                 trace.trace("Start : Filter mediator ");
             }
             if (test(synCtx)) {
-                log.debug("Filter condition satisfied.. executing child mediators");
+                if (log.isDebugEnabled()) {
+                    log.debug("Filter condition satisfied.. executing child mediators");
+                }
                 return super.mediate(synCtx);
             } else {
-                log.debug("Filter condition failed.. will skip executing child mediators");
+                if (log.isDebugEnabled()) {
+                    log.debug("Filter condition failed.. will skip executing child mediators");
+                }
                 return true;
             }
         } finally {
@@ -83,18 +89,25 @@
     public boolean test(MessageContext synCtx) {
         try {
             if (xpath != null) {
-                log.debug("Evaluating XPath expression : " + xpath);
+                if (log.isDebugEnabled()) {
+                    log.debug("Evaluating XPath expression : " + xpath);
+                }
                 if (shouldTrace(synCtx.getTracingState())) {
                     trace.trace("XPath expression : " + xpath + " evaluates to : " +
-                        xpath.booleanValueOf(synCtx.getEnvelope()));
+                            xpath.booleanValueOf(synCtx.getEnvelope()));
                 }
                 return xpath.booleanValueOf(synCtx.getEnvelope());
 
             } else if (source != null && regex != null) {
-                log.debug("Evaluating regular expression : " + regex.pattern() + " against source : " + source);
+                if (log.isDebugEnabled()) {
+                    log.debug("Evaluating regular expression : " + regex.pattern() +
+                            " against source : " + source);
+                }
                 String sourceString = Axis2MessageContext.getStringValue(source, synCtx);
                 if (sourceString == null) {
-                    log.debug("Source String has been evaluated to Null");
+                    if (log.isDebugEnabled()) {
+                        log.debug("Source String has been evaluated to Null");
+                    }
                     return false;
                 }
                 if (shouldTrace(synCtx.getTracingState())) {
@@ -103,11 +116,12 @@
                 }
                 Matcher matcher = regex.matcher(sourceString);
                 if (matcher == null) {
-                    log.warn("Can not find a Regex Pattren Matcher");
+                    if (log.isDebugEnabled()) {
+                        log.debug("Can not find a Regex Pattren Matcher");
+                    }
                     return false;
                 }
                 return matcher.matches();
-
             } else {
                 log.error("Invalid configuration specified");
                 return false;

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/InMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/InMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/InMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/InMediator.java Sun Jul 15 23:43:50 2007
@@ -43,17 +43,24 @@
      * @return true if filter condition fails. else returns as per List mediator semantics
      */
     public boolean mediate(MessageContext synCtx) {
-        log.debug("In mediator mediate()");
+
+        if (log.isDebugEnabled()) {
+            log.debug("In mediator mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
         try {
             if (shouldTrace) {
                 trace.trace("Start : In mediator");
             }
             if (test(synCtx)) {
-                log.debug("Current message is incoming.. executing child mediators");
+                if (log.isDebugEnabled()) {
+                    log.debug("Current message is incoming.. executing child mediators");
+                }
                 return super.mediate(synCtx);
             } else {
-                log.debug("Current message is not incoming.. skipping child mediators");
+                if (log.isDebugEnabled()) {
+                    log.debug("Current message is not incoming.. skipping child mediators");
+                }
                 return true;
             }
         } finally {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/OutMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/OutMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/OutMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/OutMediator.java Sun Jul 15 23:43:50 2007
@@ -43,18 +43,24 @@
      * @return true if filter condition fails. else returns as per List mediator semantics
      */
     public boolean mediate(MessageContext synCtx) {
-        log.debug("Out mediator mediate()");
+        
+        if (log.isDebugEnabled()) {
+            log.debug("Out mediator mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
         try {
             if (shouldTrace) {
                 trace.trace("Start : Out mediator");
             }
-            
             if (test(synCtx)) {
-                log.debug("Current message is outgoing.. executing child mediators");
+                if(log.isDebugEnabled()) {
+                    log.debug("Current message is outgoing.. executing child mediators");
+                }
                 return super.mediate(synCtx);
             } else {
-                log.debug("Current message is not outgoing.. skipping child mediators");
+                if(log.isDebugEnabled()) {
+                    log.debug("Current message is not outgoing.. skipping child mediators");
+                }
                 return true;
             }
         } finally {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/SwitchMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/SwitchMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/SwitchMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/filters/SwitchMediator.java Sun Jul 15 23:43:50 2007
@@ -59,22 +59,26 @@
      */
     public boolean mediate(MessageContext synCtx) {
 
-        log.debug("Switch mediator :: mediate()");
+        if (log.isDebugEnabled()) {
+            log.debug("Switch mediator :: mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
         if (shouldTrace) {
             trace.trace("Start : Switch mediator");
         }
         String sourceText = Axis2MessageContext.getStringValue(source, synCtx);
-        log.debug("Applying switch case regex patterns against evaluated source value : " + sourceText);
+        if (log.isDebugEnabled()) {
+            log.debug("Applying switch case regex patterns against evaluated source value : " +
+                    sourceText);
+        }
         try {
             saveAndSetTraceState(synCtx);
             if (shouldTrace) {
                 trace.trace("Source Value : " + sourceText);
                 trace.trace("Start Case mediator list");
             }
-            if (sourceText != null) {
-                Iterator iter = cases.iterator();
-                while (iter.hasNext()) {
+            if (sourceText != null && !cases.isEmpty()) {
+                for (Iterator iter = cases.iterator(); iter.hasNext();) {
                     SwitchCase swCase = (SwitchCase) iter.next();
                     if (swCase != null) {
                         if (swCase.matches(sourceText)) {
@@ -89,10 +93,14 @@
                     trace.trace("End Case mediator list");
                 }
             } else {
-                log.warn("Source has been evaluated to Null...Default Case will be run");
+                if (log.isDebugEnabled()) {
+                    log.debug("Source has been evaluated to Null...Default Case will be run");
+                }
             }
             if (defaultCase != null) {
-                log.debug("Executing default case");
+                if (log.isDebugEnabled()) {
+                    log.debug("Executing default case");
+                }
                 if (shouldTrace) {
                     trace.trace("Executing default case");
                 }
@@ -153,6 +161,10 @@
         return defaultCase;
     }
 
+    /**
+     * setting the default case ...which contains mediators to invoke when no case condition satisfy
+     * @param defaultCase
+     */
     public void setDefaultCase(SwitchCase defaultCase) {
         this.defaultCase = defaultCase;
     }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java Sun Jul 15 23:43:50 2007
@@ -75,7 +75,9 @@
     private String faultDetail = null;
 
     public boolean mediate(MessageContext synCtx) {
-        log.debug("Fault mediator mediate()");
+        if (log.isDebugEnabled()) {
+            log.debug("Fault mediator mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
         SOAPEnvelope envelop = synCtx.getEnvelope();
         if(shouldTrace) {
@@ -104,8 +106,9 @@
     }
 
     private boolean makeSOAPFault(MessageContext synCtx, int soapVersion,boolean shouldTrace) {
-
-        log.debug("Creating a SOAP fault using SOAP " + (soapVersion == SOAP11 ? "1.1" : "1.2"));
+        if (log.isDebugEnabled()) {
+            log.debug("Creating a SOAP fault using SOAP " + (soapVersion == SOAP11 ? "1.1" : "1.2"));
+        }
         // get the correct SOAP factory to be used
         SOAPFactory factory = (
             soapVersion == SOAP11 ? OMAbstractFactory.getSOAP11Factory() : OMAbstractFactory.getSOAP12Factory());
@@ -115,7 +118,7 @@
         SOAPEnvelope faultEnvelope = factory.getDefaultFaultEnvelope();
         soapFaultDocument.addChild(faultEnvelope);
 
-        // create the fault element  if it is need 
+        // create the fault element  if it is need
         SOAPFault fault = faultEnvelope.getBody().getFault();
         if(fault == null){
             fault = factory.createSOAPFault();
@@ -129,11 +132,10 @@
         setFaultDetail(factory, fault);
 
         // set the all headers of griginal SOAP Envelope to the Fault Envelope
-        SOAPHeader headers = synCtx.getEnvelope().getHeader();
-        if (headers != null) {
-            Iterator iter = headers.examineAllHeaderBlocks();
-            if (iter.hasNext()) {
-                while (iter.hasNext()) {
+        if (synCtx.getEnvelope() != null) {
+            SOAPHeader soapHeader = synCtx.getEnvelope().getHeader();
+            if (soapHeader != null) {
+                for (Iterator iter = soapHeader.examineAllHeaderBlocks(); iter.hasNext();) {
                     Object o = iter.next();
                     if (o instanceof SOAPHeaderBlock) {
                         SOAPHeaderBlock header = (SOAPHeaderBlock) o;
@@ -144,7 +146,9 @@
                 }
             }
         }
-        log.debug("The fault message as : " + fault);
+        if (log.isDebugEnabled()) {
+            log.debug("The fault message as : " + fault);
+        }
         // overwrite current message envelope with new fault envelope
         try {
             if (shouldTrace) {
@@ -154,8 +158,7 @@
             synCtx.setEnvelope(faultEnvelope);
         } catch (AxisFault af) {
             String msg = "Error replacing SOAP envelope with a fault envelope " + af.getMessage();
-            log.error(msg);
-            throw new SynapseException(af);
+            handleException(msg,af);
         }
 
         if (synCtx.getFaultTo() != null) {
@@ -282,10 +285,14 @@
 
             } else {
                 String msg = "Invalid Fault code value for a SOAP 1.2 fault : " + faultCodeValue;
-                log.error(msg);
-                throw new SynapseException(msg);
+                handleException(msg);
             }
         }
+    }
+
+    private void handleException(String msg, Exception e) {
+        log.error(msg, e);
+        throw new SynapseException(msg, e);
     }
 
     public AXIOMXPath getFaultCodeExpr() {

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?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- 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 Sun Jul 15 23:43:50 2007
@@ -66,24 +66,34 @@
      * @return true always
      */
     public boolean mediate(MessageContext synCtx) {
-        log.debug("Header mediator <" + (action == ACTION_SET ? "Set" : "Remove") + "> :: mediate()");
+
+        if (log.isDebugEnabled()) {
+            log.debug("Header mediator <" + (action == ACTION_SET ? "Set" : "Remove") + "> :: mediate()");
+        }
         boolean shouldTrace = shouldTrace(synCtx.getTracingState());
-        if(shouldTrace) {
+        if (shouldTrace) {
             trace.trace("Start : Header mediator, action = " +
-                (action == ACTION_SET ? "set" : "remove"));
+                    (action == ACTION_SET ? "set" : "remove"));
+        }
+        if (qName == null) {
+            if (log.isDebugEnabled()) {
+                log.debug("Hadear Name is null");
+            }
+            return true;
         }
         if (action == ACTION_SET) {
             String value = (getValue() != null ? getValue() :
-                Axis2MessageContext.getStringValue(getExpression(), synCtx));
-
-            log.debug("Setting header : " + qName + " to : " + value);
-            if(shouldTrace) {
+                    Axis2MessageContext.getStringValue(getExpression(), synCtx));
+            if (log.isDebugEnabled()) {
+                log.debug("Setting header : " + qName + " to : " + value);
+            }
+            if (shouldTrace) {
                 trace.trace("Set Header : " + qName + " to : " + value);
             }
             if (qName.getNamespaceURI() == null || "".equals(qName.getNamespaceURI())) {
                 if (Constants.HEADER_TO.equals(qName.getLocalPart())) {
                     synCtx.setTo(new EndpointReference(value));
-                } else if (Constants.HEADER_FROM.equals(qName.getLocalPart())){
+                } else if (Constants.HEADER_FROM.equals(qName.getLocalPart())) {
                     synCtx.setFrom(new EndpointReference(value));
                 } else if (Constants.HEADER_ACTION.equals(qName.getLocalPart())) {
                     synCtx.setWSAAction(value);
@@ -95,11 +105,13 @@
                     addCustomHeader(synCtx);
                 }
             } else {
-                addCustomHeader(synCtx);                
+                addCustomHeader(synCtx);
             }
 
         } else {
-            log.debug("Removing header : " + qName + " from current message");
+            if (log.isDebugEnabled()) {
+                log.debug("Removing header : " + qName + " from current message");
+            }
 
             if (shouldTrace) {
                 trace.trace("Remove Header : " + qName);
@@ -108,7 +120,7 @@
             if (qName.getNamespaceURI() == null || "".equals(qName.getNamespaceURI())) {
                 if (Constants.HEADER_TO.equals(qName.getLocalPart())) {
                     synCtx.setTo(null);
-                } else if (Constants.HEADER_FROM.equals(qName.getLocalPart())){
+                } else if (Constants.HEADER_FROM.equals(qName.getLocalPart())) {
                     synCtx.setFrom(null);
                 } else if (Constants.HEADER_ACTION.equals(qName.getLocalPart())) {
                     synCtx.setWSAAction(null);
@@ -117,11 +129,12 @@
                 } else if (Constants.HEADER_REPLY_TO.equals(qName.getLocalPart())) {
                     synCtx.setReplyTo(null);
                 } else {
-                    removeFromHeaderList(synCtx.getEnvelope().getHeader().getHeaderBlocksWithNSURI(""));
-                }                
+                    removeFromHeaderList(synCtx.getEnvelope().getHeader().
+                            getHeaderBlocksWithNSURI(""));
+                }
             } else {
                 removeFromHeaderList(synCtx.getEnvelope().getHeader().
-                    getHeaderBlocksWithNSURI(qName.getNamespaceURI()));
+                        getHeaderBlocksWithNSURI(qName.getNamespaceURI()));
             }
         }
         if (shouldTrace) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java Sun Jul 15 23:43:50 2007
@@ -149,12 +149,16 @@
      */
     public boolean mediate(MessageContext synCtx) {
         try {
-            log.debug("XSLT mediator mediate()");
+            if (log.isDebugEnabled()) {
+                log.debug("XSLT mediator mediate()");
+            }
             boolean shouldTrace = shouldTrace(synCtx.getTracingState());
             if (shouldTrace) {
                 trace.trace("Start : XSLT mediator");
             }
-            log.debug("Performing XSLT transformation against resource with key : " + xsltKey);
+            if (log.isDebugEnabled()) {
+                log.debug("Performing XSLT transformation against resource with key : " + xsltKey);
+            }
             performXLST(synCtx, shouldTrace);
             if (shouldTrace) {
                 trace.trace("Start : XSLT mediator");

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/AbstractRegistry.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/AbstractRegistry.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/AbstractRegistry.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/AbstractRegistry.java Sun Jul 15 23:43:50 2007
@@ -70,19 +70,24 @@
         // if we have cached it before, and now the cache has expired
         // get its *new* registry entry and compare versions and pick new cache duration
         } else if (entry.isExpired()) {
-
-            log.debug("Cached object has expired for key : " + entry.getKey());
+            if (log.isDebugEnabled()) {
+                log.debug("Cached object has expired for key : " + entry.getKey());
+            }
             re = getRegistryEntry(entry.getKey());
 
             if (re.getVersion() != Long.MIN_VALUE &&
                 re.getVersion() == entry.getVersion()) {
-                log.debug("Expired version number is same as current version in registry");
+                if (log.isDebugEnabled()) {
+                    log.debug("Expired version number is same as current version in registry");
+                }
 
                 // renew cache lease for another cachable duration (as returned by the
                 // new getRegistryEntry() call
                 entry.setExpiryTime(
                     System.currentTimeMillis() + re.getCachableDuration());
-                log.debug("Renew cache lease for another " + re.getCachableDuration() / 1000 + "s");
+                if (log.isDebugEnabled()) {
+                    log.debug("Renew cache lease for another " + re.getCachableDuration() / 1000 + "s");
+                }
 
                 // return cached object
                 return entry.getValue();
@@ -105,7 +110,7 @@
                 seq.setDynamic(true);
                 seq.setRegistryKey(entry.getKey());
             } else if (entry.getValue() instanceof Endpoint) {
-                Endpoint ep = (Endpoint) entry.getValue();                
+                Endpoint ep = (Endpoint) entry.getValue();
             }
 
         } else {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java Sun Jul 15 23:43:50 2007
@@ -78,8 +78,9 @@
     }
 
     public RegistryEntry getRegistryEntry(String key) {
-
-        log.debug("Perform RegistryEntry lookup for key : " + key);
+        if (log.isDebugEnabled()) {
+            log.debug("Perform RegistryEntry lookup for key : " + key);
+        }
         try {
             URL url = new URL(getRoot() + key);
             URLConnection urlc = url.openConnection();

Modified: webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/attachment/AttachmentConverter.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/attachment/AttachmentConverter.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/attachment/AttachmentConverter.java (original)
+++ webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/attachment/AttachmentConverter.java Sun Jul 15 23:43:50 2007
@@ -43,10 +43,11 @@
 	 * However if MTOM is ebabled then this method should help 
 	 */
 	public static void convertMTOM_TO_Base64(AXIOMXPath xpath, String mimeType, MessageContext synCtx) throws SynapseException{
-		
-		log.debug("Converting MTOM to Base64");
-		
-		// This should do the trick, however currently it has no effect
+        if (log.isDebugEnabled()) {
+            log.debug("Converting MTOM to Base64");
+        }
+
+        // This should do the trick, however currently it has no effect
 		// we need to manually turn off MTOM in axis2.xml
 		synCtx.setDoingMTOM(false);				
 	}
@@ -55,9 +56,11 @@
 	 * Even if MTOM is enabled we need to specify that the content needs to be optimized 
 	 */
 	public static void convertBase64_TO_MTOM(AXIOMXPath xpath, String mimeType, MessageContext synCtx) throws SynapseException{
-		log.debug("Converting Base64 to MTOM");
-		
-		SOAPBody soapBody = synCtx.getEnvelope().getBody();
+        if (log.isDebugEnabled()) {
+            log.debug("Converting Base64 to MTOM");
+        }
+
+        SOAPBody soapBody = synCtx.getEnvelope().getBody();
 		//OMElementUtils.addNameSpaces(xpath, soapBody.getFirstElement(), log);		
 		OMElement attachmentNode = getMatchingElement(xpath, soapBody);
 		

Modified: webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/attachment/AttachmentMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/attachment/AttachmentMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/attachment/AttachmentMediator.java (original)
+++ webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/attachment/AttachmentMediator.java Sun Jul 15 23:43:50 2007
@@ -41,11 +41,11 @@
 	private int mode = 0;
 	private String mimeType;
 
-	public boolean mediate(MessageContext synCtx) {			
-		
-		log.debug("Attachment Mediator, ready to mediate");
-		
-		switch(mode) {
+	public boolean mediate(MessageContext synCtx) {
+        if (log.isDebugEnabled()) {
+            log.debug("Attachment Mediator, ready to mediate");
+        }
+        switch(mode) {
 		
 			case BASE64_TO_MTOM :
 				AttachmentConverter.convertBase64_TO_MTOM(attachmentPath, mimeType, synCtx);

Modified: webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/spring/SpringMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/spring/SpringMediator.java?view=diff&rev=556522&r1=556521&r2=556522
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/spring/SpringMediator.java (original)
+++ webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/spring/SpringMediator.java Sun Jul 15 23:43:50 2007
@@ -106,7 +106,9 @@
     }
 
     private synchronized void buildAppContext(MessageContext synCtx) {
-        log.debug("Creating Spring ApplicationContext from property key : " + configKey);
+        if (log.isDebugEnabled()) {
+            log.debug("Creating Spring ApplicationContext from property key : " + configKey);
+        }
         GenericApplicationContext appContext = new GenericApplicationContext();
         XmlBeanDefinitionReader xbdr = new XmlBeanDefinitionReader(appContext);
         xbdr.setValidating(false);



---------------------------------------------------------------------
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