org.wso2.carbon.registry.core.config
Class RegistryConfigurationProcessor

java.lang.Object
  extended by org.wso2.carbon.registry.core.config.RegistryConfigurationProcessor

public class RegistryConfigurationProcessor
extends Object

Builds the registry configuration from xml document. Configuration has to be given as an input stream. Registry configuration consists of details of data sources, handlers and aspects. These information is extracted from the configuration populates the necessary components.


Nested Class Summary
static class RegistryConfigurationProcessor.HandlerDefinitionObject
          Object to store a handler definition
 
Constructor Summary
RegistryConfigurationProcessor()
           
 
Method Summary
static org.apache.axiom.om.OMElement getRegistryConfigAsXML(RegistryContext registryContext)
          Obtains the registry configuration as XML element.
static void initializeAspects(org.apache.axiom.om.OMElement configElement, RegistryContext registryContext)
          Creates and initializes an aspect.
static void populateRegistryConfig(InputStream in, RegistryContext registryContext)
          Read XML configuration from the passed InputStream, or from the classpath.
static Aspect updateAspects(org.apache.axiom.om.OMElement configElement)
          Updates an aspect based on given configuration.
static boolean updateHandler(org.apache.axiom.om.OMElement configElement, RegistryContext registryContext, String lifecyclePhase)
          Updates a handler based on given configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryConfigurationProcessor

public RegistryConfigurationProcessor()
Method Detail

populateRegistryConfig

public static void populateRegistryConfig(InputStream in,
                                          RegistryContext registryContext)
                                   throws RegistryException
Read XML configuration from the passed InputStream, or from the classpath.

Parameters:
in - an InputStream containing XML data, or null.
registryContext - the RegistryContext to populate
Throws:
RegistryException - if there's a problem

getRegistryConfigAsXML

public static org.apache.axiom.om.OMElement getRegistryConfigAsXML(RegistryContext registryContext)
Obtains the registry configuration as XML element.

Parameters:
registryContext - the Registry Context used by this registry instance.
Returns:
AXIOM element containing registry configuration.

initializeAspects

public static void initializeAspects(org.apache.axiom.om.OMElement configElement,
                                     RegistryContext registryContext)
                              throws RegistryException
Creates and initializes an aspect.

Parameters:
configElement - the aspect configuration element.
registryContext - the Registry Context used by this registry instance.
Throws:
RegistryException - if anything goes wrong.

updateAspects

public static Aspect updateAspects(org.apache.axiom.om.OMElement configElement)
                            throws RegistryException
Updates an aspect based on given configuration.

Parameters:
configElement - the aspect configuration element.
Returns:
Created aspect
Throws:
RegistryException - if anything goes wrong.

updateHandler

public static boolean updateHandler(org.apache.axiom.om.OMElement configElement,
                                    RegistryContext registryContext,
                                    String lifecyclePhase)
                             throws RegistryException
Updates a handler based on given configuration.

Parameters:
configElement - the handler configuration element.
lifecyclePhase - the lifecycle phase to which this handler belongs. The possible values are "default", "reporting" and "user".
registryContext - the Registry Context used by this registry instance.
Returns:
Created handler
Throws:
RegistryException - if anything goes wrong.


Copyright © 2012 WSO2 Inc. All Rights Reserved.