Package org.jconfig

Examples of org.jconfig.ConfigurationManager


    private void load(String resourceName,String configName) {       
      try {
            if ( configName == null ) {
                configName = "default";
            }
            ConfigurationManager myConfig = ConfigurationManager.getInstance();
            URL url = null;
            // If the string has a protocol on it, we'll assume it's an absolute
            // URL.  Otherwise, we'll assume it's a resource known to the
            // classloader.
            if (resourceName.indexOf("://") >= 0)
               {
               url = new URL(resourceName);
               } // end if
            else
               {
               ClassLoader cl = Thread.currentThread().getContextClassLoader();
               url = cl.getResource(resourceName);
               } // end else

            if (url != null) {
                File file = new File(url.getFile());
                XMLFileHandler handler = new XMLFileHandler(file.getAbsolutePath());
                myConfig.load(handler, configName);
            }
        }
        catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here


        // called when registration is done
        // here we have to get every Configuration object and add it to Va
       
        //log.debug("postRegister is called.");
       
        ConfigurationManager configMngr = ConfigurationManager.getInstance();
        String[] configNames = configMngr.getConfigurationNames();
        for (int i = 0; i < configNames.length; i++) {
            registerConfigurationMBean(configNames[i]);
        }
    }
View Full Code Here

TOP

Related Classes of org.jconfig.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.