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)
          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)
          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
 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 void reset()
Force re initialization next time


getConfiguration

public SynapseConfiguration getConfiguration(OMElement element)
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)
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 -
Returns:


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