synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r579749 [1/2] - in /webservices/synapse/trunk/java/modules: core/src/main/java/org/apache/synapse/config/xml/ extensions/src/main/java/org/apache/synapse/mediators/bsf/ extensions/src/main/java/org/apache/synapse/mediators/spring/ extension...
Date Wed, 26 Sep 2007 18:28:08 GMT
Author: asankha
Date: Wed Sep 26 11:28:04 2007
New Revision: 579749

URL: http://svn.apache.org/viewvc?rev=579749&view=rev
Log:
refactor/streamline and clean mediator factories and serializers - first pass

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractDBMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractDBMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractListMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractListMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AnonymousListMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AnonymousListMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ClassMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ClassMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DropMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DropMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FilterMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FilterMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/InMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/InMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/LogMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/LogMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/OutMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/OutMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/POJOCommandMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/POJOCommandMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RMSequenceMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RMSequenceMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SendMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SendMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SequenceMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SequenceMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SynapseMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SynapseMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ValidateMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ValidateMediatorSerializer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorFactory.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/XSLTMediatorSerializer.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediatorFactory.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediatorSerializer.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/spring/SpringMediatorFactory.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/spring/SpringMediatorSerializer.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediatorFactory.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediatorSerializer.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractDBMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractDBMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractDBMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractDBMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -73,23 +73,17 @@
  */
 public abstract class AbstractDBMediatorFactory extends AbstractMediatorFactory {
 
-    private static final Log log = LogFactory.getLog(AbstractDBMediatorFactory.class);
-
+    public static final QName URL_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "url");
     static final QName DRIVER_Q   = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "driver");
-    public static final QName URL_Q      = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "url");
     static final QName USER_Q     = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "user");
     static final QName PASS_Q     = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "password");
-    static final QName PROP_Q     = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "property");
 
     static final QName STMNT_Q    = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "statement");
     static final QName SQL_Q      = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "sql");
     static final QName PARAM_Q    = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "parameter");
     static final QName RESULT_Q   = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "result");
 
-    static final QName ATT_NAME   = new QName("name");
-    static final QName ATT_VALUE  = new QName("value");
     static final QName ATT_COLUMN = new QName("column");
-    static final QName ATT_EXPRN  = new QName("expression");
     static final QName ATT_TYPE   = new QName("type");
 
     protected void buildDataSource(OMElement elem, AbstractDBMediator mediator) {
@@ -252,16 +246,6 @@
             return a.getAttributeValue();
         }
         return null;
-    }
-
-    protected void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
-    protected void handleException(String msg, Exception e) {
-        log.error(msg, e);
-        throw new SynapseException(msg, e);
     }
 }
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractDBMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractDBMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractDBMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractDBMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -69,8 +69,6 @@
  */
 public abstract class AbstractDBMediatorSerializer extends AbstractMediatorSerializer {
 
-    private static final Log log = LogFactory.getLog(AbstractDBMediatorSerializer.class);
-    
     protected void serializeDBInformation(AbstractDBMediator mediator, OMElement dbParent) {
 
         OMElement connElt = fac.createOMElement("connection", synNS);
@@ -160,10 +158,5 @@
 
             dbParent.addChild(stmntElt);
         }
-    }
-
-    protected void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractListMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractListMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractListMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractListMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -26,6 +26,7 @@
 import org.apache.synapse.mediators.ListMediator;
 import org.apache.synapse.Mediator;
 
+import javax.xml.namespace.QName;
 import java.util.Iterator;
 
 /**
@@ -33,8 +34,6 @@
  * configuration. It recursively builds the child mediators of the list.
  */
 public abstract class AbstractListMediatorFactory extends AbstractMediatorFactory {
-
-    private static final Log log = LogFactory.getLog(AbstractListMediatorFactory.class);
 
     protected static void addChildren(OMElement el, ListMediator m) {
         Iterator it = el.getChildElements();

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractListMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractListMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractListMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractListMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -30,8 +30,6 @@
 
 public abstract class AbstractListMediatorSerializer extends AbstractMediatorSerializer {
 
-    private static final Log log = LogFactory.getLog(AbstractListMediatorSerializer.class);
-
     protected static void serializeChildren(OMElement parent, List list)
     {
         Iterator iter = list.iterator();
@@ -45,10 +43,4 @@
             }
         }
     }
-
-    private static void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -20,20 +20,44 @@
 package org.apache.synapse.config.xml;
 
 import org.apache.synapse.Mediator;
+import org.apache.synapse.SynapseException;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMAttribute;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 
 public abstract class AbstractMediatorFactory implements MediatorFactory {
 
+    /** the standard log for mediators, will assign the logger for the actual subclass */
+    protected static Log log;
+    protected static final QName ATT_NAME    = new QName("name");
+    protected static final QName ATT_VALUE   = new QName("value");
+    protected static final QName ATT_XPATH   = new QName("xpath");
+    protected static final QName ATT_REGEX   = new QName("regex");
+    protected static final QName ATT_EXPRN   = new QName("expression");
+    protected static final QName ATT_KEY     = new QName("key");
+    protected static final QName ATT_SOURCE  = new QName("source");    
+    protected static final QName ATT_ONERROR = new QName("onError");
+    protected static final QName ATT_STATS   = new QName(XMLConfigConstants.STATISTICS_ATTRIB_NAME);
+    protected static final QName PROP_Q      = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "property");
+    protected static final QName FEATURE_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "feature");
+
+    /**
+     * A constructor that makes subclasses pick up the correct logger
+     */
+    protected AbstractMediatorFactory() {
+        log = LogFactory.getLog(this.getClass());
+    }
+
     /**
      * This is to Initialize the mediator with the default attributes
      *
      * @param mediator
      * @param mediatorOmElement
      */
-    protected void initMediator(Mediator mediator, OMElement mediatorOmElement) {
+    protected void processTraceState(Mediator mediator, OMElement mediatorOmElement) {
 
         OMAttribute trace = mediatorOmElement.getAttribute(
             new QName(XMLConfigConstants.NULL_NAMESPACE, XMLConfigConstants.TRACE_ATTRIB_NAME));
@@ -48,5 +72,15 @@
                 }
             }
         }
+    }
+
+    protected static void handleException(String message, Exception e) {
+        log.error(message, e);
+        throw new SynapseException(message, e);
+    }
+
+    protected static void handleException(String message) {
+        log.error(message);
+        throw new SynapseException(message);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AbstractMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -30,17 +30,28 @@
 import org.apache.synapse.SynapseException;
 import org.apache.synapse.mediators.MediatorProperty;
 
+import javax.xml.namespace.QName;
 import java.util.Collection;
 import java.util.Iterator;
 
 public abstract class AbstractMediatorSerializer implements MediatorSerializer {
 
+    /** the standard log for mediators, will assign the logger for the actual subclass */
+    protected static Log log;
+
     protected static final OMFactory fac = OMAbstractFactory.getOMFactory();
     protected static final OMNamespace synNS
             = fac.createOMNamespace(XMLConfigConstants.SYNAPSE_NAMESPACE, "syn");
     protected static final OMNamespace nullNS
             = fac.createOMNamespace(XMLConfigConstants.NULL_NAMESPACE, "");
-    private static final Log log = LogFactory.getLog(AbstractMediatorSerializer.class);
+    protected static final QName PROP_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "property");
+
+    /**
+     * A constructor that makes subclasses pick up the correct logger
+     */
+    protected AbstractMediatorSerializer() {
+        log = LogFactory.getLog(this.getClass());
+    }
 
     /**
      * Perform common functions and finalize the mediator serialization.
@@ -49,7 +60,7 @@
      * @param mediatorOmElement the OMElement being created
      * @param mediator          the Mediator instance being serialized
      */
-    protected static void finalizeSerialization(OMElement mediatorOmElement, Mediator mediator) {
+    protected static void saveTracingState(OMElement mediatorOmElement, Mediator mediator) {
         int traceState = mediator.getTraceState();
         String traceValue = null;
         if (traceState == org.apache.synapse.SynapseConstants.TRACING_ON) {
@@ -64,7 +75,7 @@
 
     }
 
-    public void serializeMediatorProperties(OMElement parent, Collection props) {
+    protected void serializeMediatorProperties(OMElement parent, Collection props) {
 
         Iterator iter = props.iterator();
         while (iter.hasNext()) {
@@ -90,11 +101,11 @@
         }
     }
 
-    public void serializeProperties(OMElement parent, Collection props) {
+    protected void serializeProperties(OMElement parent, Collection props) {
         serializeMediatorProperties(parent, props);
     }
 
-    public void serializeNamespaces(OMElement elem, AXIOMXPath xpath) {
+    protected void serializeNamespaces(OMElement elem, AXIOMXPath xpath) {
         Iterator iter = xpath.getNamespaces().keySet().iterator();
         while (iter.hasNext()) {
             String prefix = (String) iter.next();
@@ -105,9 +116,13 @@
         }
     }
 
-    private static void handleException(String msg) {
+    protected static void handleException(String msg) {
         log.error(msg);
         throw new SynapseException(msg);
     }
 
+    protected static void handleException(String msg, Exception e) {
+        log.error(msg, e);
+        throw new SynapseException(msg, e);
+    }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AnonymousListMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AnonymousListMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AnonymousListMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AnonymousListMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -34,8 +34,6 @@
 
 public abstract class AnonymousListMediatorFactory extends AbstractListMediatorFactory {
 
-    private static final Log log = LogFactory.getLog(AnonymousListMediator.class);
-
     /**
      * To create an anonymous list mediator form OMElement
      * @param el

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AnonymousListMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AnonymousListMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AnonymousListMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/AnonymousListMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -30,8 +30,6 @@
 
 public abstract class AnonymousListMediatorSerializer extends AbstractListMediatorSerializer {
 
-    private static final Log log = LogFactory.getLog(AnonymousListMediatorSerializer.class);
-
     /**
      * To serialize an  anonymous list mediator
      *
@@ -46,10 +44,5 @@
         AnonymousListMediator mediator = (AnonymousListMediator) m;
         serializeChildren(parent, mediator.getList());
         return parent;
-    }
-
-    private static void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ClassMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ClassMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ClassMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ClassMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -44,19 +44,13 @@
  */
 public class ClassMediatorFactory extends AbstractMediatorFactory {
 
-    private static final Log log = LogFactory.getLog(ClassMediatorFactory.class);
     private static final QName CLASS_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "class");
-    private static final QName PROPERTY_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "property");
-    private static final QName ATT_NAME = new QName("name");
-    private static final QName ATT_VALUE = new QName("value");
-
 
     public Mediator createMediator(OMElement elem) {
 
         ClassMediator classMediator = new ClassMediator();
 
-        OMAttribute name = elem.getAttribute(new QName(
-                XMLConfigConstants.NULL_NAMESPACE, "name"));
+        OMAttribute name = elem.getAttribute(ATT_NAME);
         if (name == null) {
             String msg = "The name of the actual mediator class is a required attribute";
             log.error(msg);
@@ -74,7 +68,7 @@
             throw new SynapseException(msg, e);
         }
 
-        for (Iterator it = elem.getChildrenWithName(PROPERTY_Q); it.hasNext();) {
+        for (Iterator it = elem.getChildrenWithName(PROP_Q); it.hasNext();) {
             OMElement child = (OMElement) it.next();
 
             String propName = child.getAttribute(ATT_NAME).getAttributeValue();
@@ -102,17 +96,12 @@
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
         classMediator.setMediator(m);
-        initMediator(classMediator, elem);
+        processTraceState(classMediator, elem);
 
         return classMediator;
     }
 
     public QName getTagQName() {
         return CLASS_Q;
-    }
-
-    private void handleException(String message) {
-        log.error(message);
-        throw new SynapseException(message);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ClassMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ClassMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ClassMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/ClassMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -24,7 +24,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.Mediator;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.mediators.ext.ClassMediator;
 
 import javax.xml.namespace.QName;
@@ -39,9 +38,6 @@
  */
 public class ClassMediatorSerializer extends AbstractMediatorSerializer  {
 
-    private static final Log log = LogFactory.getLog(ClassMediatorSerializer.class);
-    private static final QName PROP_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "property");
-
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
         if (!(m instanceof ClassMediator)) {
@@ -49,7 +45,7 @@
         }
         ClassMediator mediator = (ClassMediator) m;
         OMElement clazz = fac.createOMElement("class", synNS);
-        finalizeSerialization(clazz, mediator);
+        saveTracingState(clazz, mediator);
 
         if (mediator.getMediator() != null && mediator.getMediator().getClass().getName() != null) {
             clazz.addAttribute(fac.createOMAttribute(
@@ -81,10 +77,5 @@
 
     public String getMediatorClassName() {
         return ClassMediator.class.getName();
-    }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -47,6 +47,8 @@
      * This will hold the QName of the clone mediator element in the xml configuration
      */
     private static final QName CLONE_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "clone");
+    private static final QName ATT_CONTPAR = new QName("continueParent");
+    private static final QName TARGET_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "target");
 
     /**
      * This method implements the createMediator method of the MediatorFactory interface
@@ -58,17 +60,15 @@
     public Mediator createMediator(OMElement elem) {
 
         CloneMediator mediator = new CloneMediator();
-        initMediator(mediator, elem);
+        processTraceState(mediator, elem);
         
-        OMAttribute continueParent = elem.getAttribute(new QName(
-                XMLConfigConstants.NULL_NAMESPACE, "continueParent"));
+        OMAttribute continueParent = elem.getAttribute(ATT_CONTPAR);
         if (continueParent != null) {
             mediator.setContinueParent(
                     Boolean.valueOf(continueParent.getAttributeValue()).booleanValue());
         }
 
-        Iterator targetElements = elem.getChildrenWithName(
-                new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "target"));
+        Iterator targetElements = elem.getChildrenWithName(TARGET_Q);
         while (targetElements.hasNext()) {
             mediator.addTarget(TargetFactory.createTarget((OMElement) targetElements.next()));
         }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/CloneMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -52,7 +52,7 @@
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
         OMElement cloneElem = fac.createOMElement("clone", synNS);
-        finalizeSerialization(cloneElem, m);
+        saveTracingState(cloneElem, m);
 
         CloneMediator clone = (CloneMediator) m;
         if (clone.isContinueParent()) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBLookupMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -19,19 +19,11 @@
 
 package org.apache.synapse.config.xml;
 
-import org.apache.synapse.config.xml.AbstractMediatorSerializer;
 import org.apache.synapse.Mediator;
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.logging.Log;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.mediators.db.DBLookupMediator;
-import org.apache.synapse.mediators.db.Statement;
-
-import javax.xml.namespace.QName;
-import java.util.Iterator;
-import java.util.Map;
-import java.sql.Types;
 
 /**
  * <dblookup>
@@ -51,8 +43,6 @@
  */
 public class DBLookupMediatorSerializer extends AbstractDBMediatorSerializer {
 
-    private static final Log log = LogFactory.getLog(DBLookupMediatorSerializer.class);
-
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
         if (!(m instanceof DBLookupMediator)) {
@@ -61,7 +51,7 @@
 
         DBLookupMediator mediator = (DBLookupMediator) m;
         OMElement dbLookup = fac.createOMElement("dblookup", synNS);
-        finalizeSerialization(dbLookup,mediator);
+        saveTracingState(dbLookup,mediator);
         serializeDBInformation(mediator, dbLookup);
 
         if (parent != null) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DBReportMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -19,19 +19,12 @@
 
 package org.apache.synapse.config.xml;
 
-import org.apache.synapse.config.xml.AbstractMediatorSerializer;
 import org.apache.synapse.Mediator;
-import org.apache.synapse.SynapseException;
-import org.apache.synapse.mediators.db.Statement;
 import org.apache.synapse.mediators.db.DBReportMediator;
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.xml.namespace.QName;
-import java.util.Iterator;
-import java.sql.Types;
-
 /**
  * <dbreport>
  *   <connection>
@@ -50,8 +43,6 @@
  */
 public class DBReportMediatorSerializer extends AbstractDBMediatorSerializer {
 
-    private static final Log log = LogFactory.getLog(DBReportMediatorSerializer.class);
-
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
         if (!(m instanceof DBReportMediator)) {
@@ -60,7 +51,7 @@
 
         DBReportMediator mediator = (DBReportMediator) m;
         OMElement dbReport = fac.createOMElement("dbReport", synNS);
-        finalizeSerialization(dbReport,mediator);
+        saveTracingState(dbReport,mediator);
         serializeDBInformation(mediator, dbReport);
 
         if (parent != null) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DropMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DropMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DropMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DropMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -41,7 +41,7 @@
         Mediator dropMediator = new DropMediator();
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(dropMediator,el);
+        processTraceState(dropMediator,el);
 
         return dropMediator;
     }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DropMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DropMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DropMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/DropMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,14 +22,10 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.builtin.DropMediator;
 
-public class DropMediatorSerializer extends AbstractMediatorSerializer
-     {
-
-    private static final Log log = LogFactory.getLog(DropMediatorSerializer.class);
+public class DropMediatorSerializer extends AbstractMediatorSerializer {
 
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
@@ -39,7 +35,7 @@
 
         DropMediator mediator = (DropMediator) m;
         OMElement drop = fac.createOMElement("drop", synNS);
-        finalizeSerialization(drop,mediator);
+        saveTracingState(drop,mediator);
 
         if (parent != null) {
             parent.addChild(drop);
@@ -49,10 +45,5 @@
 
     public String getMediatorClassName() {
         return DropMediator.class.getName();
-    }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -57,14 +57,9 @@
     private static final QName ROLE_Q        = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "role");
     private static final QName DETAIL_Q      = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "detail");
 
-    private static final QName ATT_VALUE_Q = new QName(XMLConfigConstants.NULL_NAMESPACE, "value");
-    private static final QName ATT_EXPR_Q  = new QName(XMLConfigConstants.NULL_NAMESPACE, "expression");
-
     private static final String SOAP11 = "soap11";
     private static final String SOAP12 = "soap12";
 
-    private static final Log log = LogFactory.getLog(FaultMediatorFactory.class);
-
     public Mediator createMediator(OMElement elem) {
 
         FaultMediator faultMediator = new FaultMediator();
@@ -84,8 +79,8 @@
 
         OMElement code = elem.getFirstChildWithName(CODE_Q);
         if (code != null) {
-            OMAttribute value = code.getAttribute(ATT_VALUE_Q);
-            OMAttribute expression = code.getAttribute(ATT_EXPR_Q);
+            OMAttribute value = code.getAttribute(ATT_VALUE);
+            OMAttribute expression = code.getAttribute(ATT_EXPRN);
 
             if (value != null) {
                 String strValue = value.getAttributeValue();
@@ -125,8 +120,8 @@
 
         OMElement reason = elem.getFirstChildWithName(REASON_Q);
         if (reason != null) {
-            OMAttribute value = reason.getAttribute(ATT_VALUE_Q);
-            OMAttribute expression = reason.getAttribute(ATT_EXPR_Q);
+            OMAttribute value = reason.getAttribute(ATT_VALUE);
+            OMAttribute expression = reason.getAttribute(ATT_EXPRN);
 
             if (value != null) {
                 faultMediator.setFaultReasonValue(value.getAttributeValue());
@@ -155,7 +150,7 @@
 
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(faultMediator,elem);
+        processTraceState(faultMediator,elem);
 
         OMElement node = elem.getFirstChildWithName(NODE_Q);
         if (node != null && node.getText() != null) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FaultMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,12 +22,9 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.transform.FaultMediator;
 
-import javax.xml.namespace.QName;
-
 /**
  * <pre>
  * &lt;makefault [version="soap11|soap12"]&gt;
@@ -39,10 +36,7 @@
  * &lt;/makefault&gt;
  * </pre>
  */
-public class FaultMediatorSerializer extends AbstractMediatorSerializer
-     {
-
-    private static final Log log = LogFactory.getLog(FaultMediatorSerializer.class);
+public class FaultMediatorSerializer extends AbstractMediatorSerializer {
 
     private static final String SOAP11 = "soap11";
 
@@ -56,7 +50,7 @@
 
         FaultMediator mediator = (FaultMediator) m;
         OMElement fault = fac.createOMElement("makefault", synNS);
-        finalizeSerialization(fault,mediator);
+        saveTracingState(fault,mediator);
 
         if(mediator.getSoapVersion()==FaultMediator.SOAP11) {
            fault.addAttribute(fac.createOMAttribute(
@@ -121,10 +115,5 @@
 
     public String getMediatorClassName() {
         return FaultMediator.class.getName();
-    }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FilterMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FilterMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FilterMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FilterMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -45,16 +45,14 @@
  */
 public class FilterMediatorFactory extends AbstractListMediatorFactory {
 
-    private static final Log log = LogFactory.getLog(FaultMediatorFactory.class);
-
     private static final QName FILTER_Q    = new QName(SynapseConstants.SYNAPSE_NAMESPACE, "filter");
 
     public Mediator createMediator(OMElement elem) {
         FilterMediator filter = new FilterMediator();
 
-        OMAttribute attXpath  = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "xpath"));
-        OMAttribute attSource = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "source"));
-        OMAttribute attRegex  = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "regex"));
+        OMAttribute attXpath  = elem.getAttribute(ATT_XPATH);
+        OMAttribute attSource = elem.getAttribute(ATT_SOURCE);
+        OMAttribute attRegex  = elem.getAttribute(ATT_REGEX);
 
         if (attXpath != null) {
             if (attXpath.getAttributeValue() != null && attXpath.getAttributeValue().trim().length() == 0) {
@@ -107,7 +105,7 @@
         }
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(filter,elem);
+        processTraceState(filter,elem);
         addChildren(elem, filter);
         return filter;
     }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FilterMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FilterMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FilterMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/FilterMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,7 +22,6 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.filters.FilterMediator;
 
@@ -33,10 +32,7 @@
  * &lt;/filter&gt;
  * </pre>
  */
-public class FilterMediatorSerializer extends AbstractListMediatorSerializer
-     {
-
-    private static final Log log = LogFactory.getLog(FilterMediatorSerializer.class);
+public class FilterMediatorSerializer extends AbstractListMediatorSerializer {
 
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
@@ -65,7 +61,7 @@
                 "Should have either a 'source' and a 'regex' OR an 'xpath' ");
         }
 
-        finalizeSerialization(filter, mediator);
+        saveTracingState(filter, mediator);
         serializeChildren(filter, mediator.getList());
 
         if (parent != null) {
@@ -76,10 +72,5 @@
 
     public String getMediatorClassName() {
         return FilterMediator.class.getName();
-    }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -48,17 +48,16 @@
  */
 public class HeaderMediatorFactory extends AbstractMediatorFactory  {
 
-    private static final Log log = LogFactory.getLog(HeaderMediatorFactory.class);
-
     private static final QName HEADER_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "header");
+    private static final QName ATT_ACTION = new QName("action");
 
     public Mediator createMediator(OMElement elem) {
 
         HeaderMediator headerMediator = new HeaderMediator();
-        OMAttribute name   = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "name"));
-        OMAttribute value  = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "value"));
-        OMAttribute exprn  = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "expression"));
-        OMAttribute action = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "action"));
+        OMAttribute name   = elem.getAttribute(ATT_NAME);
+        OMAttribute value  = elem.getAttribute(ATT_VALUE);
+        OMAttribute exprn  = elem.getAttribute(ATT_EXPRN);
+        OMAttribute action = elem.getAttribute(ATT_ACTION);
 
         if (name == null || name.getAttributeValue() == null) {
             String msg = "A valid name attribute is required for the header mediator";
@@ -86,7 +85,7 @@
 
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(headerMediator,elem);
+        processTraceState(headerMediator,elem);
 
         // The action attribute is optional, if provided and equals to 'remove' the
         // header mediator will act as a header remove mediator

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/HeaderMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,7 +22,6 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.transform.HeaderMediator;
 
@@ -39,9 +38,7 @@
  *      &lt;header name="qname" action="remove"/&gt;
  *   </pre>
  */
-public class HeaderMediatorSerializer extends AbstractMediatorSerializer
-     {
-    private static final Log log = LogFactory.getLog(FilterMediatorSerializer.class);
+public class HeaderMediatorSerializer extends AbstractMediatorSerializer {
 
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
@@ -51,7 +48,7 @@
 
         HeaderMediator mediator = (HeaderMediator) m;
         OMElement header = fac.createOMElement("header", synNS);
-        finalizeSerialization(header,mediator);
+        saveTracingState(header,mediator);
 
         QName qName = mediator.getQName();
         if (qName != null) {
@@ -95,10 +92,4 @@
     public String getMediatorClassName() {
         return HeaderMediator.class.getName();
     }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/InMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/InMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/InMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/InMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -42,7 +42,7 @@
         InMediator filter = new InMediator();
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(filter,elem);
+        processTraceState(filter,elem);
         addChildren(elem, filter);
         return filter;
     }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/InMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/InMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/InMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/InMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,14 +22,10 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.filters.InMediator;
 
-public class InMediatorSerializer extends AbstractListMediatorSerializer
-     {
-
-    private static final Log log = LogFactory.getLog(InMediatorSerializer.class);
+public class InMediatorSerializer extends AbstractListMediatorSerializer {
 
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
@@ -39,7 +35,7 @@
 
         InMediator mediator = (InMediator) m;
         OMElement in = fac.createOMElement("in", synNS);
-        finalizeSerialization(in,mediator);
+        saveTracingState(in,mediator);
 
         serializeChildren(in, mediator.getList());
 
@@ -51,10 +47,5 @@
 
     public String getMediatorClassName() {
         return InMediator.class.getName();
-    }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/LogMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/LogMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/LogMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/LogMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -39,13 +39,13 @@
  */
 public class LogMediatorFactory extends AbstractMediatorFactory  {
 
-    private static final Log log = LogFactory.getLog(LogMediatorFactory.class);
-
     private static final QName LOG_Q    = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "log");
     private static final String SIMPLE  = "simple";
     private static final String HEADERS = "headers";
     private static final String FULL    = "full";
     private static final String CUSTOM  = "custom";
+    private static final QName ATT_LEVEL = new QName("level");
+    private static final QName ATT_SEPERATOR = new QName("separator");
 
     public QName getTagQName() {
         return LOG_Q;
@@ -57,10 +57,10 @@
 
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(logMediator,elem);
+        processTraceState(logMediator,elem);
         
         // Set the high level set of properties to be logged (i.e. log level)
-        OMAttribute level = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "level"));
+        OMAttribute level = elem.getAttribute(ATT_LEVEL);
         if (level != null) {
             String levelstr = level.getAttributeValue();
             if (SIMPLE.equals(levelstr)) {
@@ -75,7 +75,7 @@
         }
 
         // check if a custom separator has been supplied, if so use it
-        OMAttribute separator = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "separator"));
+        OMAttribute separator = elem.getAttribute(ATT_SEPERATOR);
         if (separator != null) {
             logMediator.setSeparator(separator.getAttributeValue());
         }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/LogMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/LogMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/LogMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/LogMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,7 +22,6 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.builtin.LogMediator;
 
@@ -33,10 +32,7 @@
  * &lt;/log&gt;
  * </pre>
  */
-public class LogMediatorSerializer extends AbstractMediatorSerializer
-    {
-
-    private static final Log log = LogFactory.getLog(LogMediatorSerializer.class);
+public class LogMediatorSerializer extends AbstractMediatorSerializer {
 
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
@@ -46,7 +42,7 @@
 
         LogMediator mediator = (LogMediator) m;
         OMElement log = fac.createOMElement("log", synNS);
-        finalizeSerialization(log,mediator);
+        saveTracingState(log,mediator);
 
         if (mediator.getLogLevel() != LogMediator.SIMPLE) {
             log.addAttribute(fac.createOMAttribute(
@@ -73,10 +69,4 @@
     public String getMediatorClassName() {
         return LogMediator.class.getName();
     }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/OutMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/OutMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/OutMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/OutMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -43,7 +43,7 @@
 
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(filter,elem);
+        processTraceState(filter,elem);
 
         addChildren(elem, filter);
         return filter;

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/OutMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/OutMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/OutMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/OutMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,14 +22,10 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.filters.OutMediator;
 
-public class OutMediatorSerializer extends AbstractListMediatorSerializer
-     {
-
-    private static final Log log = LogFactory.getLog(OutMediatorSerializer.class);
+public class OutMediatorSerializer extends AbstractListMediatorSerializer {
 
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
@@ -39,7 +35,7 @@
 
         OutMediator mediator = (OutMediator) m;
         OMElement out = fac.createOMElement("out", synNS);
-        finalizeSerialization(out,mediator);
+        saveTracingState(out,mediator);
         serializeChildren(out, mediator.getList());
 
         if (parent != null) {
@@ -50,10 +46,5 @@
 
     public String getMediatorClassName() {
         return OutMediator.class.getName();
-    }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/POJOCommandMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/POJOCommandMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/POJOCommandMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/POJOCommandMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -46,21 +46,15 @@
  */
 public class POJOCommandMediatorFactory extends AbstractMediatorFactory {
 
-    private static final Log log = LogFactory.getLog(POJOCommandMediatorFactory.class);
-
     private static final QName POJO_COMMAND_Q =
-            new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "pojoCommand");
-
-    private static final QName ATT_NAME  = new QName("name");
-    private static final QName ATT_VALUE = new QName("value");
-    private static final QName ATT_EXPRN = new QName("expression");
+        new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "pojoCommand");
 
     public Mediator createMediator(OMElement elem) {
 
         POJOCommandMediator pojoMediator = new POJOCommandMediator();
 
         // Class name of the Command object should be present
-        OMAttribute name = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "name"));
+        OMAttribute name = elem.getAttribute(ATT_NAME);
         if (name == null) {
             String msg = "The name of the actual POJO command implementation class" +
                     " is a required attribute";
@@ -117,16 +111,6 @@
 
     public QName getTagQName() {
         return POJO_COMMAND_Q;
-    }
-
-    private void handleException(String message, Exception e) {
-        log.error(message, e);
-        throw new SynapseException(message, e);
-    }
-
-    private void handleException(String message) {
-        log.error(message);
-        throw new SynapseException(message);
     }
 
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/POJOCommandMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/POJOCommandMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/POJOCommandMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/POJOCommandMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -24,7 +24,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.Mediator;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.mediators.ext.POJOCommandMediator;
 
 import javax.xml.namespace.QName;
@@ -44,9 +43,6 @@
  */
 public class POJOCommandMediatorSerializer extends AbstractMediatorSerializer {
 
-    private static final Log log = LogFactory.getLog(POJOCommandMediatorSerializer.class);
-    private static final QName PROP_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "property");
-
     public OMElement serializeMediator(OMElement parent, Mediator m) {
         
         if (!(m instanceof POJOCommandMediator)) {
@@ -56,7 +52,7 @@
         POJOCommandMediator mediator = (POJOCommandMediator) m;
         
         OMElement pojoCommand = fac.createOMElement("pojoCommand", synNS);
-        finalizeSerialization(pojoCommand, mediator);
+        saveTracingState(pojoCommand, mediator);
 
         if (mediator.getCommand() != null && mediator.getCommand().getClass().getName() != null) {
             pojoCommand.addAttribute(fac.createOMAttribute(
@@ -93,10 +89,5 @@
 
     public String getMediatorClassName() {
         return POJOCommandMediator.class.getName();
-    }
-
-    private void handleException(String message) {
-        log.error(message);
-        throw new SynapseException(message);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -39,19 +39,18 @@
  * </pre>
  */
 public class PropertyMediatorFactory extends AbstractMediatorFactory {
-
-    private static final Log log = LogFactory.getLog(LogMediatorFactory.class);
-
-    private static final QName PROP_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "property");
+    private static final QName ATT_SCOPE = new QName("scope");
+    private static final QName ATT_ACTION = new QName("action");
 
     public Mediator createMediator(OMElement elem) {
 
         PropertyMediator propMediator = new PropertyMediator();
-        OMAttribute name = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "name"));
-        OMAttribute value = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "value"));
-        OMAttribute expression = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "expression"));
-        OMAttribute scope = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "scope"));
-        OMAttribute action = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "action"));
+        OMAttribute name = elem.getAttribute(ATT_NAME);
+        OMAttribute value = elem.getAttribute(ATT_VALUE);
+        OMAttribute expression = elem.getAttribute(ATT_EXPRN);
+        OMAttribute scope = elem.getAttribute(ATT_SCOPE);
+        OMAttribute action = elem.getAttribute(ATT_ACTION);
+
         if (name == null) {
             String msg = "The 'name' attribute is required for the configuration of a property mediator";
             log.error(msg);
@@ -90,7 +89,7 @@
         }
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(propMediator, elem);
+        processTraceState(propMediator, elem);
         // The action attribute is optional, if provided and equals to 'remove' the
         // property mediator will act as a property remove mediator
         if (action != null && "remove".equals(action.getAttributeValue())) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/PropertyMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,7 +22,6 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.builtin.PropertyMediator;
 
@@ -33,8 +32,6 @@
  */
 public class PropertyMediatorSerializer extends AbstractMediatorSerializer {
 
-    private static final Log log = LogFactory.getLog(PropertyMediatorSerializer.class);
-
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
         if (!(m instanceof PropertyMediator)) {
@@ -43,7 +40,7 @@
 
         PropertyMediator mediator = (PropertyMediator) m;
         OMElement property = fac.createOMElement("property", synNS);
-        finalizeSerialization(property, mediator);
+        saveTracingState(property, mediator);
 
         if (mediator.getName() != null) {
             property.addAttribute(fac.createOMAttribute(
@@ -81,10 +78,4 @@
     public String getMediatorClassName() {
         return PropertyMediator.class.getName();
     }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RMSequenceMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RMSequenceMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RMSequenceMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RMSequenceMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -40,19 +40,19 @@
  */
 public class RMSequenceMediatorFactory extends AbstractMediatorFactory {
 
-    private static final Log log = LogFactory.getLog(LogMediatorFactory.class);
-
     private static final QName SEQUENCE_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "RMSequence");
+    private static final QName ATT_CORR = new QName("correlation");
+    private static final QName ATT_LASTMSG = new QName("last-message");
+    private static final QName ATT_VERSION = new QName("version");
+    private static final QName ATT_SINGLE = new QName("single");
 
     public Mediator createMediator(OMElement elem) {
 
         RMSequenceMediator sequenceMediator = new RMSequenceMediator();
-        OMAttribute correlation =
-            elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "correlation"));
-        OMAttribute lastMessage =
-            elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "last-message"));
-        OMAttribute single = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "single"));
-        OMAttribute version = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "version"));
+        OMAttribute correlation = elem.getAttribute(ATT_CORR);
+        OMAttribute lastMessage = elem.getAttribute(ATT_LASTMSG);
+        OMAttribute single = elem.getAttribute(ATT_SINGLE);
+        OMAttribute version = elem.getAttribute(ATT_VERSION);
 
         if (single == null && correlation == null) {
             String msg = "The 'single' attribute value of true or a 'correlation' attribute is " +
@@ -140,7 +140,7 @@
 
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(sequenceMediator, elem);
+        processTraceState(sequenceMediator, elem);
 
         return sequenceMediator;
     }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RMSequenceMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RMSequenceMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RMSequenceMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/RMSequenceMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -23,7 +23,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.Mediator;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.mediators.builtin.RMSequenceMediator;
 
 /**
@@ -33,8 +32,6 @@
  */
 public class RMSequenceMediatorSerializer extends AbstractMediatorSerializer {
 
-    private static final Log log = LogFactory.getLog(RMSequenceMediatorSerializer.class);
-
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
         if (!(m instanceof RMSequenceMediator)) {
@@ -43,7 +40,7 @@
 
         RMSequenceMediator mediator = (RMSequenceMediator) m;
         OMElement sequence = fac.createOMElement("RMSequence", synNS);
-        finalizeSerialization(sequence, mediator);
+        saveTracingState(sequence, mediator);
         
         if(mediator.isSingle() && mediator.getCorrelation() != null) {
             handleException("Invalid RMSequence mediator. A RMSequence can't have both a " 
@@ -84,10 +81,4 @@
     public String getMediatorClassName() {
         return RMSequenceMediator.class.getName();
     }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SendMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SendMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SendMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SendMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -77,9 +77,8 @@
  */
 public class SendMediatorFactory extends AbstractMediatorFactory  {
 
-    private static final Log log = LogFactory.getLog(SendMediatorFactory.class);
-
     private static final QName SEND_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "send");
+    private static final QName ENDPOINT_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "endpoint");
 
     public Mediator createMediator(OMElement elem) {
 
@@ -87,9 +86,9 @@
 
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(sm,elem);
+        processTraceState(sm,elem);
 
-        OMElement epElement = elem.getFirstChildWithName(new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "endpoint"));
+        OMElement epElement = elem.getFirstChildWithName(ENDPOINT_Q);
         if (epElement != null) {
             // get the factory for the element
             // create the endpoint and set it in the send medaitor

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SendMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SendMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SendMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SendMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,7 +22,6 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.config.xml.endpoints.EndpointSerializer;
 import org.apache.synapse.config.xml.endpoints.EndpointAbstractSerializer;
@@ -72,10 +71,7 @@
  * &lt;/send&gt;
  * </pre>
  */
-public class SendMediatorSerializer extends AbstractMediatorSerializer
-     {
-
-    private static final Log log = LogFactory.getLog(SendMediatorSerializer.class);
+public class SendMediatorSerializer extends AbstractMediatorSerializer {
 
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
@@ -85,7 +81,7 @@
 
         SendMediator mediator = (SendMediator) m;
         OMElement send = fac.createOMElement("send", synNS);
-        finalizeSerialization(send, mediator);
+        saveTracingState(send, mediator);
 
         Endpoint activeEndpoint = mediator.getEndpoint();
         if (activeEndpoint != null) {
@@ -105,10 +101,4 @@
     public String getMediatorClassName() {
         return SendMediator.class.getName();
     }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SequenceMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SequenceMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SequenceMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SequenceMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -46,8 +46,6 @@
  */
 public class SequenceMediatorFactory extends AbstractListMediatorFactory {
 
-    private static final Log log = LogFactory.getLog(SequenceMediatorFactory.class);
-
     private static final QName SEQUENCE_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "sequence");
 
     public QName getTagQName() {
@@ -56,14 +54,13 @@
 
     public SequenceMediator createAnonymousSequence(OMElement elem) {
         SequenceMediator seqMediator = new SequenceMediator();
-        OMAttribute e = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "onError"));
+        OMAttribute e = elem.getAttribute(ATT_ONERROR);
         if (e != null) {
             seqMediator.setErrorHandler(e.getAttributeValue());
         }
-        initMediator(seqMediator, elem);
+        processTraceState(seqMediator, elem);
         addChildren(elem, seqMediator);
-        OMAttribute statistics = elem.getAttribute(
-                new QName(XMLConfigConstants.NULL_NAMESPACE, XMLConfigConstants.STATISTICS_ATTRIB_NAME));
+        OMAttribute statistics = elem.getAttribute(ATT_STATS);
         if (statistics != null) {
             String statisticsValue = statistics.getAttributeValue();
             if (statisticsValue != null) {
@@ -81,18 +78,18 @@
 
         SequenceMediator seqMediator = new SequenceMediator();
 
-        OMAttribute n = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "name"));
-        OMAttribute e = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "onError"));
+        OMAttribute n = elem.getAttribute(ATT_NAME);
+        OMAttribute e = elem.getAttribute(ATT_ONERROR);
         if (n != null) {
             seqMediator.setName(n.getAttributeValue());
             if (e != null) {
                 seqMediator.setErrorHandler(e.getAttributeValue());
             }
-            initMediator(seqMediator, elem);
+            processTraceState(seqMediator, elem);
             addChildren(elem, seqMediator);
 
         } else {
-            n = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "key"));
+            n = elem.getAttribute(ATT_KEY);
             if (n != null) {
                 seqMediator.setKey(n.getAttributeValue());
                 if (e != null) {
@@ -108,8 +105,7 @@
             }
         }
 
-        OMAttribute statistics = elem.getAttribute(
-                new QName(XMLConfigConstants.NULL_NAMESPACE, XMLConfigConstants.STATISTICS_ATTRIB_NAME));
+        OMAttribute statistics = elem.getAttribute(ATT_STATS);
         if (statistics != null) {
             String statisticsValue = statistics.getAttributeValue();
             if (statisticsValue != null) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SequenceMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SequenceMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SequenceMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SequenceMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,7 +22,6 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.base.SequenceMediator;
 
@@ -41,8 +40,6 @@
  */
 public class SequenceMediatorSerializer extends AbstractListMediatorSerializer {
 
-    private static final Log log = LogFactory.getLog(SequenceMediatorSerializer.class);
-
     public OMElement serializeAnonymousSequence(OMElement parent, SequenceMediator mediator) {
         OMElement sequence = fac.createOMElement("sequence", synNS);
         int isEnableStatistics = mediator.getStatisticsState();
@@ -60,7 +57,7 @@
             sequence.addAttribute(fac.createOMAttribute(
                     "onError", nullNS, mediator.getErrorHandler()));
         }
-        finalizeSerialization(sequence, mediator);
+        saveTracingState(sequence, mediator);
         serializeChildren(sequence, mediator.getList());
         if (parent != null) {
             parent.addChild(sequence);
@@ -110,7 +107,7 @@
                     sequence.addAttribute(fac.createOMAttribute(
                             "onError", nullNS, mediator.getErrorHandler()));
                 }
-                finalizeSerialization(sequence, mediator);
+                saveTracingState(sequence, mediator);
                 serializeChildren(sequence, mediator.getList());
             }
         }
@@ -124,10 +121,4 @@
     public String getMediatorClassName() {
         return SequenceMediator.class.getName();
     }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -50,8 +50,6 @@
  */
 public class SwitchMediatorFactory extends AbstractMediatorFactory {
 
-    private static final Log log = LogFactory.getLog(SwitchMediatorFactory.class);
-
     private static final QName SWITCH_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "switch");
     private static final QName CASE_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "case");
     private static final QName DEFAULT_Q = new QName(XMLConfigConstants.SYNAPSE_NAMESPACE, "default");
@@ -59,7 +57,7 @@
     public Mediator createMediator(OMElement elem) {
 
         SwitchMediator switchMediator = new SwitchMediator();
-        OMAttribute source = elem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "source"));
+        OMAttribute source = elem.getAttribute(ATT_SOURCE);
         if (source == null) {
             String msg = "A 'source' XPath attribute is required for a switch mediator";
             log.error(msg);
@@ -78,12 +76,12 @@
         }
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(switchMediator, elem);
+        processTraceState(switchMediator, elem);
         Iterator iter = elem.getChildrenWithName(CASE_Q);
         while (iter.hasNext()) {
             OMElement caseElem = (OMElement) iter.next();
             SwitchCase aCase = new SwitchCase();
-            OMAttribute regex = caseElem.getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "regex"));
+            OMAttribute regex = caseElem.getAttribute(ATT_REGEX);
             if (regex == null) {
                 String msg = "The 'regex' attribute is required for a switch case definition";
                 log.error(msg);

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SwitchMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,7 +22,6 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.filters.SwitchMediator;
 
@@ -42,8 +41,6 @@
  */
 public class SwitchMediatorSerializer extends AbstractMediatorSerializer {
 
-    private static final Log log = LogFactory.getLog(SwitchMediatorSerializer.class);
-
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
         if (!(m instanceof SwitchMediator)) {
@@ -52,7 +49,7 @@
 
         SwitchMediator mediator = (SwitchMediator) m;
         OMElement switchMed = fac.createOMElement("switch", synNS);
-        finalizeSerialization(switchMed, mediator);
+        saveTracingState(switchMed, mediator);
 
         if (mediator.getSource() != null) {
             switchMed.addAttribute(fac.createOMAttribute(
@@ -99,10 +96,4 @@
     public String getMediatorClassName() {
         return SwitchMediator.class.getName();
     }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SynapseMediatorFactory.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SynapseMediatorFactory.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SynapseMediatorFactory.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SynapseMediatorFactory.java Wed Sep 26 11:28:04 2007
@@ -48,7 +48,7 @@
 
         // after successfully creating the mediator
         // set its common attributes such as tracing etc
-        initMediator(sm,elem);
+        processTraceState(sm,elem);
 
         addChildren(elem, sm);
         return sm;

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SynapseMediatorSerializer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SynapseMediatorSerializer.java?rev=579749&r1=579748&r2=579749&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SynapseMediatorSerializer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/SynapseMediatorSerializer.java Wed Sep 26 11:28:04 2007
@@ -22,7 +22,6 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Mediator;
 import org.apache.synapse.mediators.base.SynapseMediator;
 
@@ -33,10 +32,7 @@
  * &lt;rules&gt;
  * </pre>
  */
-public class SynapseMediatorSerializer extends AbstractListMediatorSerializer
-     {
-
-    private static final Log log = LogFactory.getLog(SynapseMediatorSerializer.class);
+public class SynapseMediatorSerializer extends AbstractListMediatorSerializer {
 
     public OMElement serializeMediator(OMElement parent, Mediator m) {
 
@@ -46,7 +42,7 @@
 
         SynapseMediator mediator = (SynapseMediator) m;
         OMElement rules = fac.createOMElement("rules", synNS);
-        finalizeSerialization(rules,mediator);
+        saveTracingState(rules,mediator);
 
         serializeChildren(rules, mediator.getList());
 
@@ -59,10 +55,4 @@
     public String getMediatorClassName() {
         return SynapseMediator.class.getName();
     }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
-    }
-
 }



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