Package org.apache.synapse.config.xml
Class AbstractMediatorSerializer
- java.lang.Object
-
- org.apache.synapse.config.xml.AbstractMediatorSerializer
-
- All Implemented Interfaces:
MediatorSerializer
- Direct Known Subclasses:
AbstractDBMediatorSerializer
,AbstractListMediatorSerializer
,AggregateMediatorSerializer
,BeanMediatorSerializer
,CallMediatorSerializer
,CalloutMediatorSerializer
,ClassMediatorSerializer
,CloneMediatorSerializer
,ConditionalRouterMediatorSerializer
,DropMediatorSerializer
,EJBMediatorSerializer
,EnqueueMediatorSerializer
,EnrichMediatorSerializer
,EventPublisherMediatorSerializer
,FaultMediatorSerializer
,ForEachMediatorSerializer
,HeaderMediatorSerializer
,InvokeMediatorSerializer
,IterateMediatorSerializer
,JSONTransformMediatorSerializer
,LogMediatorSerializer
,LoopBackMediatorSerializer
,MessageStoreMediatorSerializer
,NTLMMediatorSerializer
,PayloadFactoryMediatorSerializer
,POJOCommandMediatorSerializer
,PropertyGroupMediatorSerializer
,PropertyMediatorSerializer
,RespondMediatorSerializer
,SamplingThrottleMediatorSerializer
,SendMediatorSerializer
,SwitchMediatorSerializer
,TransactionMediatorSerializer
,URLRewriteMediatorSerializer
,XSLTMediatorSerializer
public abstract class AbstractMediatorSerializer extends Object implements MediatorSerializer
Parent class for all theMediatorSerializer
implementations
-
-
Field Summary
Fields Modifier and Type Field Description protected static QName
DESCRIPTION_Q
protected static org.apache.axiom.om.OMFactory
fac
protected static org.apache.commons.logging.Log
log
the standard log for mediators, will assign the logger for the actual subclassprotected static org.apache.axiom.om.OMNamespace
nullNS
protected static QName
PROP_Q
protected static org.apache.axiom.om.OMNamespace
synNS
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMediatorSerializer()
A constructor that makes subclasses pick up the correct logger
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
handleException(String msg)
protected void
handleException(String msg, Exception e)
protected static void
saveTracingState(org.apache.axiom.om.OMElement mediatorOmElement, Mediator mediator)
Perform common functions and finalize the mediator serialization.protected void
serializeComments(org.apache.axiom.om.OMElement parent, List<String> commentList)
Serialize String Comment entries from a Listprotected org.apache.axiom.om.OMElement
serializeComments(org.apache.axiom.om.OMElement parent, Mediator m)
Serialize String Comment entries from a Listorg.apache.axiom.om.OMElement
serializeMediator(org.apache.axiom.om.OMElement parent, Mediator m)
Serializes the given mediator into XML element.protected void
serializeMediatorProperties(org.apache.axiom.om.OMElement parent, Collection<MediatorProperty> props)
protected void
serializeMediatorProperties(org.apache.axiom.om.OMElement parent, Collection<MediatorProperty> props, QName childElementName)
protected void
serializeNamespaces(org.apache.axiom.om.OMElement elem, org.apache.axiom.om.xpath.AXIOMXPath xpath)
protected void
serializeProperties(org.apache.axiom.om.OMElement parent, Collection<MediatorProperty> props)
protected abstract org.apache.axiom.om.OMElement
serializeSpecificMediator(Mediator m)
Specific mediator factory implementations should implement this method to build theMediator
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 org.apache.axiom.om.OMFactory fac
-
synNS
protected static final org.apache.axiom.om.OMNamespace synNS
-
nullNS
protected static final org.apache.axiom.om.OMNamespace nullNS
-
PROP_Q
protected static final QName PROP_Q
-
DESCRIPTION_Q
protected static final QName DESCRIPTION_Q
-
-
Method Detail
-
serializeMediator
public final org.apache.axiom.om.OMElement serializeMediator(org.apache.axiom.om.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 theserializeSpecificMediator(org.apache.synapse.Mediator)
method, which has tobe implemented by the respective mediatorsIt is treating the
AnonymousListMediator
as a special case and calls it's children serialization, since there is nothing specific to be serialized in that caseThis method has been marked as
final
to avoid mistakenly overwriting this method instead of theserializeSpecificMediator(org.apache.synapse.Mediator)
by the sub classes- Specified by:
serializeMediator
in interfaceMediatorSerializer
- Parameters:
parent
- the OMElement to which the serialization should be attachedm
- mediator to be serialized- Returns:
- the serialized Element
-
serializeSpecificMediator
protected abstract org.apache.axiom.om.OMElement serializeSpecificMediator(Mediator m)
Specific mediator factory implementations should implement this method to build theMediator
by the given XML configuration- Parameters:
m
- mediator to be serialized- Returns:
- serialized element of the mediator
-
saveTracingState
protected static void saveTracingState(org.apache.axiom.om.OMElement mediatorOmElement, Mediator mediator)
Perform common functions and finalize the mediator serialization. i.e. process any common attributes- Parameters:
mediatorOmElement
- the OMElement being createdmediator
- the Mediator instance being serialized
-
serializeMediatorProperties
protected void serializeMediatorProperties(org.apache.axiom.om.OMElement parent, Collection<MediatorProperty> props, QName childElementName)
-
serializeMediatorProperties
protected void serializeMediatorProperties(org.apache.axiom.om.OMElement parent, Collection<MediatorProperty> props)
-
serializeProperties
protected void serializeProperties(org.apache.axiom.om.OMElement parent, Collection<MediatorProperty> props)
-
serializeNamespaces
protected void serializeNamespaces(org.apache.axiom.om.OMElement elem, org.apache.axiom.om.xpath.AXIOMXPath xpath)
-
handleException
protected void handleException(String msg)
-
serializeComments
protected void serializeComments(org.apache.axiom.om.OMElement parent, List<String> commentList)
Serialize String Comment entries from a List- Parameters:
parent
- OMElement to be updatedcommentList
- List of comment entries to be serialized
-
serializeComments
protected org.apache.axiom.om.OMElement serializeComments(org.apache.axiom.om.OMElement parent, Mediator m)
Serialize String Comment entries from a List- Parameters:
parent
- OMElement to be updatedm
- Comment mediator instance which contains comment information
-
-