Package org.impalaframework.module

Examples of org.impalaframework.module.RuntimeModule


    public RuntimeModule getRuntimeModule(String moduleName) {
        Assert.notNull(moduleStateHolder);
        Assert.notNull(moduleName);
       
        final RuntimeModule runtimeModule = moduleStateHolder.getModule(moduleName);
        return runtimeModule;
    }
View Full Code Here


        if (moduleStateHolder.getModule(moduleName) == null) {

            ModuleRuntime moduleRuntime = getModuleRuntime(currentDefinition);
           
            try {
                RuntimeModule runtimeModule = moduleRuntime.loadRuntimeModule(currentDefinition);
                moduleStateHolder.putModule(moduleName, runtimeModule);
            }
            catch (RuntimeException e) {
               
                try {
View Full Code Here

        final String moduleDefinition = currentDefinition.getName();
        logger.info("Unloading module " + moduleDefinition);

        boolean success = true;

        RuntimeModule runtimeModule = moduleStateHolder.removeModule(moduleDefinition);
        if (runtimeModule != null) {
            try {
                ModuleRuntime moduleRuntime = getModuleRuntime(currentDefinition);
                moduleRuntime.closeModule(runtimeModule);
            }
View Full Code Here

        }
        return null;
    }

    public RuntimeModule getRootRuntimeModule() {
        RuntimeModule runtimeModule = getModuleStateHolder().getRootModule();
        if (runtimeModule == null) {
            throw new NoServiceException("No root application has been loaded");
        }
        return runtimeModule;
    }
View Full Code Here

        }
        return runtimeModule;
    }

    public RuntimeModule getModuleContext(String moduleName) {
        RuntimeModule runtimeModule = getModuleStateHolder().getModule(moduleName);
        if (runtimeModule == null) {
            throw new NoServiceException("No runtime module " + moduleName + " is available");
        }
        return runtimeModule;
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public <T extends Object> T getBean(String beanName, Class<T> t) {
       
        RuntimeModule runtimeModule = getRootRuntimeModule();
        return (T) checkBeanType(runtimeModule, beanName, t);
    }
View Full Code Here

    }
   
    @SuppressWarnings("unchecked")
    public <T extends Object> T getModuleBean(String moduleName, String beanName, Class<T> t) {
       
        RuntimeModule runtimeModule = getModuleContext(moduleName);
        return (T) checkBeanType(runtimeModule, beanName, t);
    }
View Full Code Here

    /*
     * ******************* InternalOperationsFacade methods * **************************
     */

    public RuntimeModule getRuntimeModule(String moduleName) {
        final RuntimeModule runtimeModule = getModuleStateHolder().getModule(moduleName);
       
        if (runtimeModule == null) {
            throw new NoServiceException("No module named '" + moduleName + "' has been loaded");
        }
       
View Full Code Here

    }
   
    public void testGetParentApplicationContextWithNonSpringModule() throws Exception {

        SpringRuntimeModule module1 = createMock(SpringRuntimeModule.class);
        RuntimeModule module2 = createMock(RuntimeModule.class);
        SpringRuntimeModule module3 = createMock(SpringRuntimeModule.class);
       
        expect(definition3.getParentDefinition()).andReturn(definition2);
        expect(definition2.getName()).andReturn("definition2");
        expect(moduleStateHolder.getModule("definition2")).andReturn(module2);
View Full Code Here

        final SimpleModuleDefinition definition = new SimpleModuleDefinition("mymodule");
        expect(classLoaderFactory.newClassLoader(application, ClassUtils.getDefaultClassLoader(), definition)).andReturn(ClassUtils.getDefaultClassLoader());
       
        replay(classLoaderFactory, classLoaderRegistry);
       
        final RuntimeModule module = runtime.doLoadModule(application, definition);
        assertTrue(module instanceof SimpleRuntimeModule);
       
        verify(classLoaderFactory, classLoaderRegistry);
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.module.RuntimeModule

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.