Search in sources :

Example 6 with Module

use of com.qcadoo.plugin.api.Module in project qcadoo by qcadoo.

the class CustomModuleFactory method parseElement.

@Override
protected Module parseElement(final String pluginIdentifier, final Element element) {
    String className = getRequiredAttribute(element, "class");
    Class<?> clazz = null;
    try {
        clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
    } catch (ClassNotFoundException e) {
        throw new IllegalStateException("Missing class " + className + " of " + getIdentifier() + " module", e);
    }
    Module module = (Module) applicationContext.getBean(clazz);
    checkNotNull(className, "Missing bean " + className + " of " + getIdentifier() + " module");
    return module;
}
Also used : Module(com.qcadoo.plugin.api.Module)

Aggregations

Module (com.qcadoo.plugin.api.Module)6 ModuleFactory (com.qcadoo.plugin.api.ModuleFactory)4 InternalPlugin (com.qcadoo.plugin.internal.api.InternalPlugin)4 ArrayList (java.util.ArrayList)3 Plugin (com.qcadoo.plugin.api.Plugin)2 MultiTenantCallback (com.qcadoo.tenant.api.MultiTenantCallback)2 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 PluginStateResolver (com.qcadoo.plugin.api.PluginStateResolver)1 PluginUtilsService (com.qcadoo.plugin.internal.PluginUtilsService)1 MultiTenantUtil (com.qcadoo.tenant.api.MultiTenantUtil)1 DefaultMultiTenantService (com.qcadoo.tenant.internal.DefaultMultiTenantService)1 Test (org.junit.Test)1 InOrder (org.mockito.InOrder)1 Node (org.w3c.dom.Node)1