Package org.impalaframework.module.loader

Examples of org.impalaframework.module.loader.ModuleLoaderRegistry


    public void testProcessTransitions() {
       
        DefaultModuleStateHolder moduleStateHolder = new DefaultModuleStateHolder();
        DefaultTransitionManager transitionManager = new DefaultTransitionManager();
        ModuleLoaderRegistry registry = new ModuleLoaderRegistry();
        ModuleLocationResolver resolver = new StandaloneModuleLocationResolver();

        CustomClassLoaderFactory classLoaderFactory = new CustomClassLoaderFactory();
        classLoaderFactory.setModuleLocationResolver(resolver);
       
        ApplicationModuleLoader rootModuleLoader = new ApplicationModuleLoader();
       
        registry.addItem("spring-"+ModuleTypes.ROOT, rootModuleLoader);
        ApplicationModuleLoader applicationModuleLoader = new ApplicationModuleLoader();
       
        registry.addItem("spring-"+ModuleTypes.APPLICATION, applicationModuleLoader);
        DefaultApplicationContextLoader contextLoader = new DefaultApplicationContextLoader();
        contextLoader.setModuleLoaderRegistry(registry);
        contextLoader.setDelegatingContextLoaderRegistry(new DelegatingContextLoaderRegistry());
       
        TransitionProcessorRegistry transitionProcessors = new TransitionProcessorRegistry();
View Full Code Here


    private ModuleLoader moduleLoader2;
    private ModuleLoaderRegistry moduleLoaderRegistry;
    private TypeReaderRegistry typeReaderRegistry;
   
    public void setUp() {
        moduleLoaderRegistry = new ModuleLoaderRegistry();
        typeReaderRegistry = new TypeReaderRegistry();
       
        contributor = new NamedBeanRegistryContributor();
       
        contributor.setRegistryBeanName("myRegistry");
View Full Code Here

        Object bean = appContext.getBean("moduleManagementFacade");
        facade = ObjectUtils.cast(bean, ModuleManagementFacade.class);
       
        StandaloneModuleLocationResolver resolver = new StandaloneModuleLocationResolver();

        ModuleLoaderRegistry registry = facade.getModuleLoaderRegistry();
        ApplicationModuleLoader rootModuleLoader = new ApplicationModuleLoader();

        CustomClassLoaderFactory classLoaderFactory = new CustomClassLoaderFactory();
        classLoaderFactory.setModuleLocationResolver(resolver);
       
        registry.addItem(ModuleTypes.ROOT, rootModuleLoader) ;
        ApplicationModuleLoader applicationModuleLoader = new ApplicationModuleLoader();

        registry.addItem(ModuleTypes.APPLICATION, applicationModuleLoader);

        ApplicationManager applicationManager = facade.getApplicationManager();
        application = applicationManager.getCurrentApplication();
        moduleStateHolder = (DefaultModuleStateHolder) application.getModuleStateHolder();
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        loader = new BaseApplicationContextLoader();
        moduleLoaderRegistry = new ModuleLoaderRegistry();
        loader.setModuleLoaderRegistry(moduleLoaderRegistry);
        definition = new SimpleModuleDefinition("mymod");

        moduleLoader = createMock(SpringModuleLoader.class);
        applicationContext = createMock(ConfigurableApplicationContext.class);
View Full Code Here

    private ModuleLoaderRegistry moduleLoaderRegistry;
    private DelegatingContextLoaderRegistry delegatingContextLoaderRegistry;
   
    @Override
    protected void setUp() throws Exception {
        moduleLoaderRegistry = new ModuleLoaderRegistry();
        delegatingContextLoaderRegistry = new DelegatingContextLoaderRegistry();
    }
View Full Code Here

    public void testBootstrapContext() throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                new String[]{"META-INF/impala-bootstrap.xml"});
        ModificationExtractorRegistry calculatorRegistry = (ModificationExtractorRegistry) context
                .getBean("modificationExtractorRegistry");
        ModuleLoaderRegistry registry = (ModuleLoaderRegistry) context.getBean("moduleLoaderRegistry");
       
        assertNotNull(registry.getModuleLoader("spring-"+ModuleTypes.ROOT));
        assertNotNull(registry.getModuleLoader("spring-"+ModuleTypes.APPLICATION));

        ApplicationManager applicationManager = (ApplicationManager) context.getBean("applicationManager");
        Application application = applicationManager.getCurrentApplication();
       
        RootModuleDefinition definition = new Provider().getModuleDefinition();
View Full Code Here

  private BeanDefinitionReader beanDefinitionReader;

    private Application application;

  public final void testProcess() {
    ModuleLoaderRegistry registry = new ModuleLoaderRegistry();

    AddLocationsTransitionProcessor processor = new AddLocationsTransitionProcessor(registry);
    RootModuleDefinition originalSpec = SharedModuleDefinitionSources.newTest1().getModuleDefinition();
    RootModuleDefinition newSpec = SharedModuleDefinitionSources.newTest1a().getModuleDefinition();
    ClassLoader classLoader = ClassUtils.getDefaultClassLoader();
   
    moduleStateHolder = createMock(DefaultModuleStateHolder.class);
    context = createMock(ConfigurableApplicationContext.class);
    moduleLoader = createMock(SpringModuleLoader.class);
    beanDefinitionReader = createMock(BeanDefinitionReader.class);
        application = TestApplicationManager.newApplicationManager(null, moduleStateHolder, null).getCurrentApplication();

    registry.addItem(originalSpec.getType(), moduleLoader);

    Resource[] resources1 = new Resource[]{ new FileSystemResource("r1")};
    Resource[] resources2 = new Resource[]{ new FileSystemResource("r1"), new FileSystemResource("r2")};
    Resource[] resources3 = new Resource[]{ new FileSystemResource("r2")};
View Full Code Here

  private ModuleLoaderRegistry registry;

  public void afterPropertiesSet() throws Exception {
    Assert.notNull(moduleLocationResolver, "moduleLocationResolver cannot be null");

    registry = new ModuleLoaderRegistry();
    if (reloadableParent)
      registry.setModuleLoader(ModuleTypes.ROOT, new ManualReloadingRootModuleLoader(moduleLocationResolver));
    else
      registry.setModuleLoader(ModuleTypes.ROOT, new SystemRootModuleLoader(moduleLocationResolver));
View Full Code Here

TOP

Related Classes of org.impalaframework.module.loader.ModuleLoaderRegistry

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.