Example usage for org.apache.commons.configuration JNDIConfiguration JNDIConfiguration

List of usage examples for org.apache.commons.configuration JNDIConfiguration JNDIConfiguration

Introduction

In this page you can find the example usage for org.apache.commons.configuration JNDIConfiguration JNDIConfiguration.

Prototype

public JNDIConfiguration(Context context) 

Source Link

Document

Creates a JNDIConfiguration using the specified initial context as the root of the properties.

Usage

From source file:com.germinus.easyconf.JndiURL.java

public Configuration getConfiguration() {
    try {/*from  w ww . j av a2  s .  c o m*/
        return new JNDIConfiguration(getPrefix());
    } catch (NamingException e) {
        throw new ConfigurationException("Error loading JNDI configuration for " + getPrefix());
    }
}

From source file:org.chenillekit.core.services.impl.ConfigurationServiceImpl.java

/**
 * get the configuration from JNDI context.
 *
 * @param context the JNDI context/*from w w  w . j  av a 2 s .  c o m*/
 *
 * @return the configuration
 */
public Configuration getConfiguration(Context context) {
    assert context != null;
    return new JNDIConfiguration(context);
}

From source file:org.overlord.sramp.ui.server.listeners.Initializer.java

/**
 * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
 */// www.ja  v  a2 s . c  o  m
@Override
public void contextInitialized(ServletContextEvent event) {
    try {
        CompositeConfiguration config = new CompositeConfiguration();
        config.addConfiguration(new SystemConfiguration());
        config.addConfiguration(new JNDIConfiguration("java:comp/env/overlord/s-ramp-ui"));
        config.addConfiguration(new PropertiesConfiguration(
                Initializer.class.getResource("/META-INF/config/org.overlord.sramp.ui.server.api.properties")));
        System.out.println("S-RAMP user interface configuration loaded.  S-RAMP Atom API endpoint: "
                + config.getString("s-ramp.atom-api.endpoint"));

        // Now initialize the S-RAMP Atom API Client singleton
        SrampAtomApiClient.init(config);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}