Search in sources :

Example 1 with AutomagicMadvocConfigurator

use of jodd.madvoc.config.AutomagicMadvocConfigurator in project jodd by oblac.

the class Madvoc method loadMadvocConfig.

/**
	 * Loads {@link jodd.madvoc.config.MadvocConfigurator}. If class name is <code>null</code>,
	 * {@link jodd.madvoc.config.AutomagicMadvocConfigurator} will be created.
	 */
protected MadvocConfigurator loadMadvocConfig() {
    if ((madvocConfiguratorClassName != null) && (madvocConfiguratorClass != null)) {
        throw new MadvocException("Ambiguous MadvocConfigurator setting");
    }
    if ((madvocConfiguratorClassName == null) && (madvocConfiguratorClass == null)) {
        log.info("Configuring Madvoc using default automagic configurator");
        return new AutomagicMadvocConfigurator();
    }
    MadvocConfigurator configurator;
    try {
        if (madvocConfiguratorClass == null) {
            madvocConfiguratorClass = ClassLoaderUtil.loadClass(madvocConfiguratorClassName);
        }
        configurator = (MadvocConfigurator) madvocConfiguratorClass.newInstance();
        log.info("Configuring Madvoc using configurator: " + madvocConfiguratorClass.getName());
    } catch (Exception ex) {
        throw new MadvocException("Unable to load Madvoc configurator class: " + madvocConfiguratorClassName, ex);
    }
    return configurator;
}
Also used : AutomagicMadvocConfigurator(jodd.madvoc.config.AutomagicMadvocConfigurator) MadvocConfigurator(jodd.madvoc.config.MadvocConfigurator) AutomagicMadvocConfigurator(jodd.madvoc.config.AutomagicMadvocConfigurator)

Example 2 with AutomagicMadvocConfigurator

use of jodd.madvoc.config.AutomagicMadvocConfigurator in project jodd by oblac.

the class DefaultWebApplication method configure.

/**
	 * Configures <code>AutomagicMadvocConfigurator</code>.
	 */
@Override
public void configure(MadvocConfigurator configurator) {
    if (configurator instanceof AutomagicMadvocConfigurator) {
        AutomagicMadvocConfigurator madvocConfigurator = (AutomagicMadvocConfigurator) configurator;
        defaultAppCore.getAppScanner().configure(madvocConfigurator);
    }
    super.configure(configurator);
}
Also used : AutomagicMadvocConfigurator(jodd.madvoc.config.AutomagicMadvocConfigurator)

Aggregations

AutomagicMadvocConfigurator (jodd.madvoc.config.AutomagicMadvocConfigurator)2 MadvocConfigurator (jodd.madvoc.config.MadvocConfigurator)1