org.wso2.carbon.mediation.initializer

## Class RegistryBasedSynapseConfigBuilder

- java.lang.Object
- - org.wso2.carbon.mediation.initializer.RegistryBasedSynapseConfigBuilder

-     public class RegistryBasedSynapseConfigBuilder
      extends Object

  Builds the `SynapseConfiguration` by using a registry space, which defaults to /carbon/synapse-config

  The configuration element hierarchy has assumed to be;

  - CONFIG_REGISTRY/repository/synapse/sequences
  - CONFIG_REGISTRY/repository/synapse/endpoints
  - CONFIG_REGISTRY/repository/synapse/local-entries
  - CONFIG_REGISTRY/repository/synapse/proxy-services
  - CONFIG_REGISTRY/repository/synapse/event-sources
  - CONFIG_REGISTRY/repository/synapse/synapse-startups
  - CONFIG_REGISTRY/repository/synapse/synapse-registry
  The above resource paths corresponds to the relevant elements, and if there is no main and fault sequences the builder will add a default sequence for those.
  See Also:
    `ServiceBusConstants.RegistryStore`, `RegistryBasedSynapseConfigSerializer`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegistryBasedSynapseConfigBuilder(org.wso2.carbon.registry.core.session.UserRegistry registry, String configName, String synapseXMLLocation, Properties properties, boolean failSafeConfigurationLoading)` Constructs the builder and sets the registry to be used

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.synapse.config.SynapseConfiguration` | `getConfiguration()` Builds the `SynapseConfiguration` from the registry space.
    `void` | `handleErrorGracefully(String component, org.apache.synapse.SynapseException e)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RegistryBasedSynapseConfigBuilder

          public RegistryBasedSynapseConfigBuilder(org.wso2.carbon.registry.core.session.UserRegistry registry,
                                                   String configName,
                                                   String synapseXMLLocation,
                                                   Properties properties,
                                                   boolean failSafeConfigurationLoading)

      Constructs the builder and sets the registry to be used
      Parameters:
        `registry` - to be used to retrieve the configuration elements
        `configName` - configuration name
        `synapseXMLLocation` - location of the synapse xml
        `properties` - the properties from the synapse.properties file
        `failSafeConfigurationLoading` - to load configurations in a fail safe way

  - ### Method Detail

    - #### getConfiguration

          public org.apache.synapse.config.SynapseConfiguration getConfiguration()

      Builds the `SynapseConfiguration` from the registry space. If the synapse registry has been specified and there are no content in the rest of the config space, this method looks for the registry configured in the synapse-registry to find a synapse.xml file....

      If non of the above is able to provide the configuration fall back to the default configuration

      Returns:
        configuration constructed from the registry config space

    - #### handleErrorGracefully

          public void handleErrorGracefully(String component,
                                            org.apache.synapse.SynapseException e)

Copyright © 2018 WSO2. All rights reserved.