Class AbstractMediatorSerializer

    • 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
    • Constructor Detail

      • AbstractMediatorSerializer

        protected AbstractMediatorSerializer()
        A constructor that makes subclasses pick up the correct logger
    • 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 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 org.apache.axiom.om.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​(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 created
        mediator - 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)
      • handleException

        protected void handleException​(String msg,
                                       Exception e)
      • 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 updated
        commentList - 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 updated
        m - Comment mediator instance which contains comment information