Examples of RuntimeModule


Examples of com.acme.RuntimeModule

  private LoggingService logger;
 
  public static void main(final String[] args) {
    Main _main = new Main();
    final Main instance = _main;
    RuntimeModule _runtimeModule = new RuntimeModule();
    Injector _createInjector = Guice.createInjector(_runtimeModule);
    _createInjector.injectMembers(instance);
    instance.logTheData();
  }
View Full Code Here

Examples of org.impalaframework.module.RuntimeModule

    public static void main(String[] args) {
        InteractiveTestRunner.run(MessageIntegrationTest.class);
    }

    public void testIntegration() {
        RuntimeModule rootRuntimeModule = Impala.getRootRuntimeModule();
        assertTrue(rootRuntimeModule instanceof SpringRuntimeModule);
    }
View Full Code Here

Examples of org.impalaframework.module.RuntimeModule

    public static void main(String[] args) {
        InteractiveTestRunner.run(MessageIntegrationTest.class);
    }

    public void testIntegration() {
        RuntimeModule rootRuntimeModule = Impala.getRootRuntimeModule();
        assertTrue(rootRuntimeModule instanceof SpringRuntimeModule);
    }
View Full Code Here

Examples of org.impalaframework.module.RuntimeModule

        final List<ApplicationContext> applicationContexts = new ArrayList<ApplicationContext>();
       
        for (ModuleDefinition moduleDefinition : dependencies) {
           
            final String currentName = moduleDefinition.getName();
            final RuntimeModule runtimeModule = graphModuleStateHolder.getModule(currentName);
            if (runtimeModule instanceof SpringRuntimeModule) {
                SpringRuntimeModule spr = (SpringRuntimeModule) runtimeModule;
                applicationContexts.add(spr.getApplicationContext());
            }
        }
View Full Code Here

Examples of org.impalaframework.module.RuntimeModule

        ModuleDefinition parentDefinition = definition.getParentDefinition();
       
        while (parentDefinition != null) {
           
            final String parentName = parentDefinition.getName();
            final RuntimeModule parentModule = getModuleStateHolder().getModule(parentName);
            if (parentModule instanceof SpringRuntimeModule) {
                SpringRuntimeModule springRuntimeModule = (SpringRuntimeModule) parentModule;
                parentContext = springRuntimeModule.getApplicationContext();
                break;
            }
View Full Code Here

Examples of org.impalaframework.module.RuntimeModule

    public static ConfigurableApplicationContext getRootSpringContext(ModuleStateHolder moduleStateHolder) {

        Assert.notNull(moduleStateHolder);
       
        final RuntimeModule runtimeModule = moduleStateHolder.getRootModule();
        return getModuleSpringContext(runtimeModule);
    }
View Full Code Here

Examples of org.impalaframework.module.RuntimeModule

    public static ConfigurableApplicationContext getModuleSpringContext(ModuleStateHolder moduleStateHolder, String moduleName) {

        Assert.notNull(moduleStateHolder);
        Assert.notNull(moduleName);
       
        final RuntimeModule runtimeModule = moduleStateHolder.getModule(moduleName);
        return getModuleSpringContext(runtimeModule);
    }
View Full Code Here

Examples of org.impalaframework.module.RuntimeModule

            String directoryName = (String) GlobalCommandState.getInstance().getValue(
                    CommandStateConstants.DIRECTORY_NAME);
           
            ClassLoader parent = null;

            RuntimeModule runtimeModule = null;
           
            try {              
                if (directoryName != null && !InteractiveCommandUtils.isRootProject(directoryName)) {
                    runtimeModule = Impala.getRuntimeModule(directoryName);
                }
                else {
                    runtimeModule = Impala.getRootRuntimeModule();
                }
            }
            catch (NoServiceException e) {
                //we're not terribly interested in this situation - simply means that the module context has not been loaded
            }
           
            if (runtimeModule != null) {
                parent = runtimeModule.getClassLoader();
            } else {
                parent = ClassUtils.getDefaultClassLoader();
            }

            c = Class.forName(testClassName, false, parent);
View Full Code Here

Examples of org.impalaframework.module.RuntimeModule

           
            ModuleManagementFacade moduleManagementFacade = WebServletUtils.getModuleManagementFacade(servletContext);
            if (moduleManagementFacade != null) {
               
                Application application = moduleManagementFacade.getApplicationManager().getApplication(applicationId);
                RuntimeModule currentModuleContext = application.getModuleStateHolder().getModule(moduleName);
               
                if (currentModuleContext != null) {
                    return new StateProtectingHttpSession(session, webAttributeQualifier, applicationId, moduleName, currentModuleContext.getClassLoader());
                } else {
                    logger.warn("No module application context associated with module: " + moduleName + ". Using unwrapped session");
                    return session;
                }
            }
View Full Code Here

Examples of org.impalaframework.module.RuntimeModule

    protected abstract String getMethodName(CommandState commandState, Class<?> testClass);

    private ClassLoader getTestClassLoader(String testClassName) {
        String currentDirectoryName = getCurrentDirectoryName(true);

        RuntimeModule runtimeModule = null;

        try {
            if (currentDirectoryName != null && !InteractiveCommandUtils.isRootProject(currentDirectoryName)) {
                runtimeModule = Impala.getRuntimeModule(currentDirectoryName);
            }
            else {
                runtimeModule = Impala.getRootRuntimeModule();
            }
        }
        catch (RuntimeException e) {
            System.out.println("No module loaded for current directory: " + currentDirectoryName);
            runtimeModule = Impala.getRootRuntimeModule();
        }

        ClassLoader parentClassLoader = null;

        if (runtimeModule != null)
            parentClassLoader = runtimeModule.getClassLoader();
        else
            parentClassLoader = ClassUtils.getDefaultClassLoader();
       
        ClassLoader testClassLoader = getTestClassLoader(parentClassLoader, testClassName);
        return testClassLoader;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.