Package org.tubo.configuration

Examples of org.tubo.configuration.ConfigurationManager


     * @throws TuboKernelException If somthing fail
     */
    public Kernel createKernel() throws TuboKernelException {
        //
        // create a ConfigurationManager
        ConfigurationManager configurationManager;
        try {
            configurationManager = new ConfigurationManager();
        } catch (TuboConfigurationException e) {
            throw new TuboKernelException("ConfigurationManager can't be created",e);
        }
        //
        // load base configuration
        try {
            String baseConfig = getBaseConfigLocation();
            log.info(".createKernel() - Loading base config url="+baseConfig);
            configurationManager.appendResource(baseConfig);
        } catch (TuboConfigurationException e) {
            throw new TuboKernelException("Base Config Location can't be configured",e);
        }
        //
        // append custom connfiguration
        for (Iterator it=configLocations.iterator(); it.hasNext();) {
            String resourceLocation = (String)it.next();
            log.info(".createKernel() - Appendig config url="+configLocations);
            try {
                configurationManager.appendResource(resourceLocation);
            } catch (TuboConfigurationException e) {
                throw new TuboKernelException("Config "+resourceLocation+" has problems to be appened",e);
            }
        }
        //
        // create a instance of KernelBuilder based on configuration
        String kernelBuilderClassName = configurationManager.getConfiguration().getKernelBuilderClassName();
        KernelBuilder kernelBuilder;
        try {
            kernelBuilder = (KernelBuilder)Class.forName(kernelBuilderClassName).newInstance();
        } catch (InstantiationException e) {
            throw new TuboKernelException("Error instanciating KernelBuilder ("+kernelBuilderClassName+")",e);
View Full Code Here

TOP

Related Classes of org.tubo.configuration.ConfigurationManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.