Package org.impalaframework.spring.module

Examples of org.impalaframework.spring.module.DelegatingContextLoader


        ConfigurableApplicationContext context = null;
       
        final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(definition), false);
        final SpringModuleLoader moduleLoader = ObjectUtils.cast(loader, SpringModuleLoader.class);
       
        final DelegatingContextLoader delegatingLoader = delegatingContextLoaderRegistry.getDelegatingLoader(definition.getType());

        try {

            if (moduleLoader != null) {
                if (logger.isDebugEnabled()) logger.debug("Loading module " + definition + " using ModuleLoader " + moduleLoader);
                context = loadApplicationContext(application, classLoader, moduleLoader, parent, definition);
               
                final String applicationId = application.getId();
                moduleLoader.afterRefresh(applicationId, context, definition);
            }
            else if (delegatingLoader != null) {
                if (logger.isDebugEnabled()) logger.debug("Loading module " + definition + " using DelegatingContextLoader " + moduleLoader);
                context = delegatingLoader.loadApplicationContext(parent, definition);
            }
            else {
                throw new ConfigurationException("No " + ModuleLoader.class.getName() + " or "
                        + DelegatingContextLoader.class.getName() + " specified for module definition type " + definition.getType());
            }
View Full Code Here


        ConfigurableApplicationContext context = null;
       
        final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(definition), false);
        final SpringModuleLoader moduleLoader = ObjectUtils.cast(loader, SpringModuleLoader.class);
       
        final DelegatingContextLoader delegatingLoader = delegatingContextLoaderRegistry.getDelegatingLoader(definition.getType());

        try {

            if (moduleLoader != null) {
                if (logger.isDebugEnabled()) logger.debug("Loading module " + definition + " using ModuleLoader " + moduleLoader);
                context = loadApplicationContext(application, classLoader, moduleLoader, parent, definition);
               
                final String applicationId = application.getId();
                moduleLoader.afterRefresh(applicationId, context, definition);
            }
            else if (delegatingLoader != null) {
                if (logger.isDebugEnabled()) logger.debug("Loading module " + definition + " using DelegatingContextLoader " + moduleLoader);
                context = delegatingLoader.loadApplicationContext(parent, definition);
            }
            else {
                throw new ConfigurationException("No " + ModuleLoader.class.getName() + " or "
                        + DelegatingContextLoader.class.getName() + " specified for module definition type " + definition.getType());
            }
View Full Code Here

        ConfigurableApplicationContext context = null;
       
        final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(definition), false);
        final SpringModuleLoader moduleLoader = ObjectUtils.cast(loader, SpringModuleLoader.class);
       
        final DelegatingContextLoader delegatingLoader = delegatingContextLoaderRegistry.getDelegatingLoader(definition.getType());

        try {

            if (moduleLoader != null) {
                if (logger.isDebugEnabled()) logger.debug("Loading module " + definition + " using ModuleLoader " + moduleLoader);
                context = loadApplicationContext(moduleLoader, parent, definition);
                moduleLoader.afterRefresh(context, definition);
            }
            else if (delegatingLoader != null) {
                if (logger.isDebugEnabled()) logger.debug("Loading module " + definition + " using DelegatingContextLoader " + moduleLoader);
                context = delegatingLoader.loadApplicationContext(parent, definition);
            }
            else {
                throw new ConfigurationException("No " + ModuleLoader.class.getName() + " or "
                        + DelegatingContextLoader.class.getName() + " specified for module definition type " + definition.getType());
            }
View Full Code Here

        moduleLoaderRegistry.addItem(ModuleTypes.APPLICATION, applicationModuleLoader);

        ModuleDefinition p = new SimpleRootModuleDefinition(rootModuleName, new String[] { "parent-context.xml" });
        assertTrue(moduleLoaderRegistry.getModuleLoader(p.getType()) instanceof ApplicationModuleLoader);

        DelegatingContextLoader delegatingLoader = new DelegatingContextLoader() {
            public ConfigurableApplicationContext loadApplicationContext(ApplicationContext parent,
                    ModuleDefinition definition) {
                return null;
            }
        };
View Full Code Here

        Map<String, ModuleLoader> moduleLoaders = setModuleLoaders();
       
        assertEquals(2, moduleLoaders.size());

        Map<String,DelegatingContextLoader> delegatingLoaders = new HashMap<String, DelegatingContextLoader>();
        DelegatingContextLoader delegatingLoader = new DelegatingContextLoader() {
            public ConfigurableApplicationContext loadApplicationContext(ApplicationContext parent,
                    ModuleDefinition definition) {
                return null;
            }
        };
View Full Code Here

    ConfigurableApplicationContext context = null;
   
    final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(definition), false);
    final SpringModuleLoader moduleLoader = ObjectUtils.cast(loader, SpringModuleLoader.class);
   
    final DelegatingContextLoader delegatingLoader = delegatingContextLoaderRegistry.getDelegatingLoader(definition.getType());

    try {

      if (moduleLoader != null) {
        if (logger.isDebugEnabled()) logger.debug("Loading module " + definition + " using ModuleLoader " + moduleLoader);
        context = loadApplicationContext(moduleLoader, parent, definition);
        moduleLoader.afterRefresh(context, definition);
      }
      else if (delegatingLoader != null) {
        if (logger.isDebugEnabled()) logger.debug("Loading module " + definition + " using DelegatingContextLoader " + moduleLoader);
        context = delegatingLoader.loadApplicationContext(parent, definition);
      }
      else {
        throw new ConfigurationException("No " + ModuleLoader.class.getName() + " or "
            + DelegatingContextLoader.class.getName() + " specified for module definition type " + definition.getType());
      }
View Full Code Here

TOP

Related Classes of org.impalaframework.spring.module.DelegatingContextLoader

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.