Package org.apache.synapse.config.xml
Class MultiXMLConfigurationSerializer
- java.lang.Object
-
- org.apache.synapse.config.xml.MultiXMLConfigurationSerializer
-
public class MultiXMLConfigurationSerializer extends Object
-
-
Constructor Summary
Constructors Constructor Description MultiXMLConfigurationSerializer(String directoryPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isWritable()
void
serialize(SynapseConfiguration synapseConfig)
Serializes the given SynapseConfiguration to the file system.org.apache.axiom.om.OMElement
serializeAPI(API api, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeComments(String comment, org.apache.axiom.om.OMElement parent)
Serialize input Comment string to a OMElementorg.apache.axiom.om.OMElement
serializeEndpoint(Endpoint epr, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeEventSource(SynapseEventSource source, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeExecutor(org.apache.synapse.commons.executors.PriorityExecutor source, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeImport(SynapseImport synapseImport, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeInboundEndpoint(InboundEndpoint inboundEndpoint, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeLocalEntry(Object o, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeMessageProcessor(MessageProcessor messageProcessor, SynapseConfiguration synapseConfiguration, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeMessageStore(MessageStore messagestore, SynapseConfiguration synConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeProxy(ProxyService service, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeSequence(SequenceMediator seq, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeSynapseRegistry(Registry registry, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
void
serializeSynapseXML(SynapseConfiguration synapseConfig)
Serialize only the elements defined in the top level synapse.xml file back to the synapse.xml file.org.apache.axiom.om.OMElement
serializeTask(Startup task, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeTaskManager(org.apache.synapse.task.TaskManager taskManager, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeTemplate(Template template, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
org.apache.axiom.om.OMElement
serializeTemplate(TemplateMediator template, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent)
-
-
-
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
-
serializeSynapseRegistry
public org.apache.axiom.om.OMElement serializeSynapseRegistry(Registry registry, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
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
-
serializeProxy
public org.apache.axiom.om.OMElement serializeProxy(ProxyService service, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeEventSource
public org.apache.axiom.om.OMElement serializeEventSource(SynapseEventSource source, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeTask
public org.apache.axiom.om.OMElement serializeTask(Startup task, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeSequence
public org.apache.axiom.om.OMElement serializeSequence(SequenceMediator seq, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeTemplate
public org.apache.axiom.om.OMElement serializeTemplate(TemplateMediator template, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeTemplate
public org.apache.axiom.om.OMElement serializeTemplate(Template template, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeEndpoint
public org.apache.axiom.om.OMElement serializeEndpoint(Endpoint epr, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeLocalEntry
public org.apache.axiom.om.OMElement serializeLocalEntry(Object o, 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
-
serializeMessageStore
public org.apache.axiom.om.OMElement serializeMessageStore(MessageStore messagestore, SynapseConfiguration synConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeMessageProcessor
public org.apache.axiom.om.OMElement serializeMessageProcessor(MessageProcessor messageProcessor, SynapseConfiguration synapseConfiguration, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeAPI
public org.apache.axiom.om.OMElement serializeAPI(API api, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeInboundEndpoint
public org.apache.axiom.om.OMElement serializeInboundEndpoint(InboundEndpoint inboundEndpoint, SynapseConfiguration synapseConfig, org.apache.axiom.om.OMElement parent) throws Exception
- Throws:
Exception
-
serializeImport
public org.apache.axiom.om.OMElement serializeImport(SynapseImport synapseImport, 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 commentparent
- Parent OMElement to be added with new Comment element- Returns:
- Updated patent element
-
-