Search in sources :

Example 1 with Configurable

use of org.collectionspace.chain.csp.config.Configurable in project application by collectionspace.

the class CSPManagerImpl method configure.

@Override
public void configure(InputSource in, EntityResolver er, boolean forXsdGeneration) throws CSPDependencyException {
    RuleSetImpl rules = new RuleSetImpl();
    for (Configurable config : config_csps) {
        config.configure(rules);
    }
    if (forXsdGeneration == true) {
        String msg = String.format("Config Generation: '%s' - ### Generating Service configuration from '%s'.", in.getPublicId(), in.getPublicId());
        log.trace(msg);
    }
    try {
        ConfigParser parser = new ConfigParser(rules, er);
        parser.parse(in);
        // Finish up all the config-related tasks
        for (Configurable config : config_csps) {
            config.config_finish();
        }
        // Run the post-config init tasks
        for (Configurable config : config_csps) {
            config.complete_init(this, forXsdGeneration);
        }
    } catch (ConfigException e) {
        String msg = String.format("Config Generation: '%s' - Trouble parsing configuration files.", in.getPublicId());
        // XXX
        throw new CSPDependencyException(msg, e);
    }
}
Also used : CSPDependencyException(org.collectionspace.csp.api.core.CSPDependencyException) ConfigParser(org.collectionspace.chain.csp.config.impl.parser.ConfigParser) ConfigException(org.collectionspace.chain.csp.config.ConfigException) Configurable(org.collectionspace.chain.csp.config.Configurable) RuleSetImpl(org.collectionspace.chain.csp.config.impl.main.RuleSetImpl)

Aggregations

ConfigException (org.collectionspace.chain.csp.config.ConfigException)1 Configurable (org.collectionspace.chain.csp.config.Configurable)1 RuleSetImpl (org.collectionspace.chain.csp.config.impl.main.RuleSetImpl)1 ConfigParser (org.collectionspace.chain.csp.config.impl.parser.ConfigParser)1 CSPDependencyException (org.collectionspace.csp.api.core.CSPDependencyException)1