org.apache.synapse.config.xml
Class ConfigurationFactoryAndSerializerFinder

java.lang.Object
  extended by org.apache.synapse.config.xml.ConfigurationFactoryAndSerializerFinder
All Implemented Interfaces:
XMLToObjectMapper

public class ConfigurationFactoryAndSerializerFinder
extends Object
implements XMLToObjectMapper

This class is based on J2SE Service Provider model http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service%20Provider

It deals with both the problem of turning an XML into a Synapse config and vice-versa


Method Summary
 SynapseConfiguration getConfiguration(OMElement element, Properties properties)
          This method returns a Processor given an OMElement.
 Map getFactoryMap()
          This method exposes all the ConfigurationFactories and its Extensions
static ConfigurationFactoryAndSerializerFinder getInstance()
           
 Object getObjectFromOMNode(OMNode om, Properties properties)
          Allow the mediator factory finder to act as an XMLToObjectMapper for Mediators (i.e.
static Map getSerializerMap()
          This method exposes all the ConfigurationSerializer and its Extensions
static void reset()
          Force re initialization next time
static OMElement serializeConfiguration(SynapseConfiguration synCfg)
           
static OMElement serializeConfiguration(SynapseConfiguration synCfg, QName qName)
          This method will serialize the config using the supplied QName (looking up the right class to do it)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ConfigurationFactoryAndSerializerFinder getInstance()

reset

public static void reset()
Force re initialization next time


getConfiguration

public SynapseConfiguration getConfiguration(OMElement element,
                                             Properties properties)
This method returns a Processor given an OMElement. This will be used recursively by the elements which contain processor elements themselves (e.g. rules)

Parameters:
element -
Returns:
Processor

serializeConfiguration

public static OMElement serializeConfiguration(SynapseConfiguration synCfg)
Parameters:
synCfg -
Returns:

serializeConfiguration

public static OMElement serializeConfiguration(SynapseConfiguration synCfg,
                                               QName qName)
This method will serialize the config using the supplied QName (looking up the right class to do it)

Parameters:
synCfg -
qName -
Throws:
javax.xml.stream.XMLStreamException

getFactoryMap

public Map getFactoryMap()
This method exposes all the ConfigurationFactories and its Extensions

Returns:
Map of factories

getSerializerMap

public static Map getSerializerMap()
This method exposes all the ConfigurationSerializer and its Extensions

Returns:
Map of serializers

getObjectFromOMNode

public Object getObjectFromOMNode(OMNode om,
                                  Properties properties)
Allow the mediator factory finder to act as an XMLToObjectMapper for Mediators (i.e. Sequence Mediator) loaded dynamically from a Registry

Specified by:
getObjectFromOMNode in interface XMLToObjectMapper
Parameters:
om - configuration from which the object is built
properties - bag of properties to pass in any information to the factory
Returns:
built object


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.