Package org.apache.commons.configuration

Examples of org.apache.commons.configuration.MapConfiguration


     * Get the graph properties in a configuration format.
     *
     * @return the graph configuration.
     */
    public Configuration getConfiguration() {
        return new MapConfiguration(properties);
    }
View Full Code Here


        public Configuration getConfiguration() {
            Properties properties = getProperties();
            if (properties == null) {
                return null;
            } else {
                return new MapConfiguration(properties);
            }
        }
View Full Code Here

    private VirtualHost _vHost;


    public TestApplicationRegistry()
    {
        super(new MapConfiguration(new HashMap()));
    }
View Full Code Here

    propConfig.setReloadingStrategy(fileChangedReloadingStrategy);
    compositeConfig.addConfiguration(propConfig);
   
    // Properties from the persistence layer (must first initialize the entityManagerFactory).
    PersistenceManager.initializeEntityManagerFactory(propConfig.getString(Property.JUDDI_PERSISTENCEUNIT_NAME));
    MapConfiguration persistentConfig = new MapConfiguration(getPersistentConfiguration(compositeConfig));
   
    compositeConfig.addConfiguration(persistentConfig);
    //Making the new configuration globally accessible.
    config = compositeConfig;
  }
View Full Code Here

     * @throws ClientException that may wrap NoSuchAlgorithmException, KeyManagementException, MalformedURLException, UnsupportedEncodingException, KeyStoreException, IOException, or CertificateException
     */
    public ApiClient(URL baseURL, Properties properties) throws ClientException {
        try {
        setBaseURL(baseURL);
        Configuration config = new MapConfiguration(properties);
        setKeystore(config);
        log.debug("Base URL: "+baseURL.toExternalForm());
        httpClient = new ApacheHttpClient(baseURL, keystore, config);
        }
        catch(Exception e) {
View Full Code Here

                    p.setProperty("mtwilson.api.ssl.requireTrustedCertificate", WLMPConfig.getConfiguration().getString("mtwilson.api.ssl.requireTrustedCertificate", "true")); // must be secure out of the box!
                    p.setProperty("mtwilson.api.ssl.verifyHostname", WLMPConfig.getConfiguration().getString("mtwilson.api.ssl.verifyHostname", "true")); // must be secure out of the box!
  
                    // Instantiate the API Client object and store it in the session. Otherwise either we need
                    // to store the password in the session or the decrypted RSA key
                    ApiClient rsaApiClient = new ApiClient(baseURL, keystore, new MapConfiguration(p));
       
                    //Storing variable into a session object used while calling into RESt Services.
                    HttpSession session = req.getSession();
                    session.setAttribute("logged-in", true);
                    session.setAttribute("username",username);
View Full Code Here

                        logger.info("Trust Dashboard: mtwilson.api.ssl.policy="+TDPConfig.getConfiguration().getString("mtwilson.api.ssl.policy"));
                        p.setProperty("mtwilson.api.ssl.policy", TDPConfig.getConfiguration().getString("mtwilson.api.ssl.policy", "TRUST_CA_VERIFY_HOSTNAME")); // must be secure out of the box!
                        p.setProperty("mtwilson.api.ssl.requireTrustedCertificate", TDPConfig.getConfiguration().getString("mtwilson.api.ssl.requireTrustedCertificate", "true")); // must be secure out of the box!
                        p.setProperty("mtwilson.api.ssl.verifyHostname", TDPConfig.getConfiguration().getString("mtwilson.api.ssl.verifyHostname", "true")); // must be secure out of the box!
      
                        ApiClient rsaApiClient = new ApiClient(baseURL, keystore, new MapConfiguration(p));
                        X509Certificate[] trustedCertificates = new X509Certificate[0]; // keystore.getTrustedCertificates(SimpleKeystore.SAML);
      
                        //Storing information into a request session. These variables are used in DemoPortalDataController.
                        HttpSession session = req.getSession();
      session.setAttribute("logged-in", true);
View Full Code Here

     * @throws IOException
     */
    public static Configuration fromInputStream(InputStream properties) throws IOException {
        Properties p = new Properties();
        p.load(properties);
        return new MapConfiguration(p);       
    }
View Full Code Here

    log.info("Reading property file " +  propertiesFilename);
    if (in != null) {
      try {
        Properties properties = new Properties();
        properties.load(in);
        MapConfiguration classpath = new MapConfiguration(properties);
        dumpConfiguration(classpath, "classpath:/" + propertiesFilename);
        composite.addConfiguration(classpath);
      } finally {
        in.close();
      }
View Full Code Here

            }
        }

        // last priority are the defaults that were passed in, we use them if no better source was found
        if( defaults != null ) {
            MapConfiguration defaultconfig = new MapConfiguration(defaults);
            dumpConfiguration(defaultconfig, "default");
            composite.addConfiguration(defaultconfig);
        }
        dumpConfiguration(composite, "composite");
        return composite;
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.MapConfiguration

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.