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 theMediatorSerializerimplementations
-
-
Field Summary
Fields Modifier and Type Field Description protected static QNameDESCRIPTION_Qprotected static org.apache.axiom.om.OMFactoryfacprotected static org.apache.commons.logging.Loglogthe standard log for mediators, will assign the logger for the actual subclassprotected static org.apache.axiom.om.OMNamespacenullNSprotected static QNamePROP_Qprotected static org.apache.axiom.om.OMNamespacesynNS
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMediatorSerializer()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 voidhandleException(String msg)protected voidhandleException(String msg, Exception e)protected static voidsaveTracingState(org.apache.axiom.om.OMElement mediatorOmElement, Mediator mediator)Perform common functions and finalize the mediator serialization.protected voidserializeComments(org.apache.axiom.om.OMElement parent, List<String> commentList)Serialize String Comment entries from a Listprotected org.apache.axiom.om.OMElementserializeComments(org.apache.axiom.om.OMElement parent, Mediator m)Serialize String Comment entries from a Listorg.apache.axiom.om.OMElementserializeMediator(org.apache.axiom.om.OMElement parent, Mediator m)Serializes the given mediator into XML element.protected voidserializeMediatorProperties(org.apache.axiom.om.OMElement parent, Collection<MediatorProperty> props)protected voidserializeMediatorProperties(org.apache.axiom.om.OMElement parent, Collection<MediatorProperty> props, QName childElementName)protected voidserializeNamespaces(org.apache.axiom.om.OMElement elem, org.apache.axiom.om.xpath.AXIOMXPath xpath)protected voidserializeProperties(org.apache.axiom.om.OMElement parent, Collection<MediatorProperty> props)protected abstract org.apache.axiom.om.OMElementserializeSpecificMediator(Mediator m)Specific mediator factory implementations should implement this method to build theMediatorby 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
AnonymousListMediatoras 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
finalto avoid mistakenly overwriting this method instead of theserializeSpecificMediator(org.apache.synapse.Mediator)by the sub classes- Specified by:
serializeMediatorin 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 theMediatorby 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
-
-