Class MultiXMLConfigurationSerializer


  • public class MultiXMLConfigurationSerializer
    extends Object
    • Constructor Detail

      • MultiXMLConfigurationSerializer

        public MultiXMLConfigurationSerializer​(String directoryPath)
    • Method Detail

      • serialize

        public void serialize​(SynapseConfiguration synapseConfig)
        Serializes the given SynapseConfiguration to the file system. This method is NOT thread safe and hence it must not be called by multiple concurrent threads. This method will first serialize the configuration to a temporary directory at the same level as the rootDirectory and then rename/move it as the new rootDirectory. If an error occurs while saving the configuration, the temporary files will be not be removed from the file system.
        Parameters:
        synapseConfig - configuration to be serialized
      • isWritable

        public boolean isWritable()
      • serializeSynapseXML

        public void serializeSynapseXML​(SynapseConfiguration synapseConfig)
                                 throws Exception
        Serialize only the elements defined in the top level synapse.xml file back to the synapse.xml file. This method ignores the elements defined in files other than the synapse.xml. Can be used in situations where only the synapse.xml file should be updated at runtime.
        Parameters:
        synapseConfig - Current Synapse configuration
        Throws:
        Exception - on file I/O error
      • serializeTaskManager

        public org.apache.axiom.om.OMElement serializeTaskManager​(org.apache.synapse.task.TaskManager taskManager,
                                                                  SynapseConfiguration synapseConfig,
                                                                  org.apache.axiom.om.OMElement parent)
                                                           throws Exception
        Throws:
        Exception
      • serializeExecutor

        public org.apache.axiom.om.OMElement serializeExecutor​(org.apache.synapse.commons.executors.PriorityExecutor source,
                                                               SynapseConfiguration synapseConfig,
                                                               org.apache.axiom.om.OMElement parent)
                                                        throws Exception
        Throws:
        Exception
      • serializeComments

        public org.apache.axiom.om.OMElement serializeComments​(String comment,
                                                               org.apache.axiom.om.OMElement parent)
        Serialize input Comment string to a OMElement
        Parameters:
        comment - String comment
        parent - Parent OMElement to be added with new Comment element
        Returns:
        Updated patent element