org.apache.synapse.config.xml
Class AbstractMediatorSerializer

java.lang.Object
  extended by org.apache.synapse.config.xml.AbstractMediatorSerializer
All Implemented Interfaces:
MediatorSerializer
Direct Known Subclasses:
AbstractDBMediatorSerializer, AbstractListMediatorSerializer, AggregateMediatorSerializer, CacheMediatorSerializer, CalloutMediatorSerializer, ClassMediatorSerializer, CloneMediatorSerializer, ConditionalRouterMediatorSerializer, DropMediatorSerializer, EnqueueMediatorSerializer, EnrichMediatorSerializer, EventPublisherMediatorSerializer, FaultMediatorSerializer, HeaderMediatorSerializer, InvokeMediatorSerializer, IterateMediatorSerializer, LogMediatorSerializer, MessageStoreMediatorSerializer, PayloadFactoryMediatorSerializer, POJOCommandMediatorSerializer, PropertyMediatorSerializer, RMSequenceMediatorSerializer, SamplingThrottleMediatorSerializer, ScriptMediatorSerializer, SendMediatorSerializer, SpringMediatorSerializer, SwitchMediatorSerializer, ThrottleMediatorSerializer, TransactionMediatorSerializer, URLRewriteMediatorSerializer, XQueryMediatorSerializer, XSLTMediatorSerializer

public abstract class AbstractMediatorSerializer
extends Object
implements MediatorSerializer

Parent class for all the MediatorSerializer implementations


Field Summary
protected static QName DESCRIPTION_Q
           
protected static OMFactory fac
           
protected static org.apache.commons.logging.Log log
          the standard log for mediators, will assign the logger for the actual subclass
protected static OMNamespace nullNS
           
protected static QName PROP_Q
           
protected static OMNamespace synNS
           
 
Constructor Summary
protected AbstractMediatorSerializer()
          A constructor that makes subclasses pick up the correct logger
 
Method Summary
protected  void handleException(String msg)
           
protected  void handleException(String msg, Exception e)
           
protected static void saveTracingState(OMElement mediatorOmElement, Mediator mediator)
          Perform common functions and finalize the mediator serialization.
 OMElement serializeMediator(OMElement parent, Mediator m)
          Serializes the given mediator into XML element.
protected  void serializeMediatorProperties(OMElement parent, Collection<MediatorProperty> props)
           
protected  void serializeMediatorProperties(OMElement parent, Collection<MediatorProperty> props, QName childElementName)
           
protected  void serializeNamespaces(OMElement elem, AXIOMXPath xpath)
           
protected  void serializeProperties(OMElement parent, Collection<MediatorProperty> props)
           
protected abstract  OMElement serializeSpecificMediator(Mediator m)
          Specific mediator factory implementations should implement this method to build the Mediator by the given XML configuration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.synapse.config.xml.MediatorSerializer
getMediatorClassName
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the standard log for mediators, will assign the logger for the actual subclass


fac

protected static final OMFactory fac

synNS

protected static final OMNamespace synNS

nullNS

protected static final OMNamespace nullNS

PROP_Q

protected static final QName PROP_Q

DESCRIPTION_Q

protected static final QName DESCRIPTION_Q
Constructor Detail

AbstractMediatorSerializer

protected AbstractMediatorSerializer()
A constructor that makes subclasses pick up the correct logger

Method Detail

serializeMediator

public final OMElement serializeMediator(OMElement parent,
                                         Mediator m)
Serializes the given mediator into XML element. This method handles adding the common information from the respective mediators to the element it get by delegating the mediator specific serialization to the serializeSpecificMediator(org.apache.synapse.Mediator) method, which has tobe implemented by the respective mediators

It is treating the AnonymousListMediator as a special case and calls it's children serialization, since there is nothing specific to be serialized in that case

This method has been marked as final to avoid mistakenly overwriting this method instead of the serializeSpecificMediator(org.apache.synapse.Mediator) by the sub classes

Specified by:
serializeMediator in interface MediatorSerializer
Parameters:
parent - the OMElement to which the serialization should be attached
m - mediator to be serialized
Returns:
the serialized Element

serializeSpecificMediator

protected abstract OMElement serializeSpecificMediator(Mediator m)
Specific mediator factory implementations should implement this method to build the Mediator by the given XML configuration

Parameters:
m - mediator to be serialized
Returns:
serialized element of the mediator

saveTracingState

protected static void saveTracingState(OMElement mediatorOmElement,
                                       Mediator mediator)
Perform common functions and finalize the mediator serialization. i.e. process any common attributes

Parameters:
mediatorOmElement - the OMElement being created
mediator - the Mediator instance being serialized

serializeMediatorProperties

protected void serializeMediatorProperties(OMElement parent,
                                           Collection<MediatorProperty> props,
                                           QName childElementName)

serializeMediatorProperties

protected void serializeMediatorProperties(OMElement parent,
                                           Collection<MediatorProperty> props)

serializeProperties

protected void serializeProperties(OMElement parent,
                                   Collection<MediatorProperty> props)

serializeNamespaces

protected void serializeNamespaces(OMElement elem,
                                   AXIOMXPath xpath)

handleException

protected void handleException(String msg)

handleException

protected void handleException(String msg,
                               Exception e)


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.