Package org.impalaframework.module

Examples of org.impalaframework.module.RootModuleDefinition


    }
   
    public boolean isModuleDefinitionPresent(String moduleName) {
        Assert.notNull(moduleName, "moduleName cannot be null");
        Assert.notNull(moduleStateHolder, "moduleStateHolder cannot be null");
        RootModuleDefinition rootModuleDefinition = moduleStateHolder.getModuleDefinition();
        boolean isPresent = (rootModuleDefinition.findChildDefinition(moduleName, true) != null);
        if (!isPresent) {
            isPresent = rootModuleDefinition.getName().equals(moduleName);
        }
        return isPresent;
    }
View Full Code Here


    public RootModuleDefinition getRootModuleDefinition() {
        return rootModuleDefinition;
    }

    public RootModuleDefinition cloneRootModuleDefinition() {
        RootModuleDefinition newDefinition = ModuleDefinitionUtils.cloneAndUnfreeze(rootModuleDefinition);
        return newDefinition;
    }
View Full Code Here

   
    /**
     * Returns sorted list of 'capabilities' from module definition
     */
    public Collection<String> getCapabilities() {
        final RootModuleDefinition rootModuleDefinition = rootModuleDefinition();
        if (rootModuleDefinition == null) {
            return Collections.emptyList();
        }
        CapabilitiesCallback callback = new CapabilitiesCallback();
        ModuleDefinitionWalker.walkRootDefinition(rootModuleDefinition, callback);
View Full Code Here

     * Will differ from result of {@link #isModulePresent(String)} if module failed to load
     */
    public boolean isModuleDefinitionPresent(String moduleName) {
        Assert.notNull(moduleName, "moduleName cannot be null");
        Assert.notNull(moduleStateHolder, "moduleStateHolder cannot be null");
        RootModuleDefinition rootModuleDefinition = rootModuleDefinition();
        boolean isPresent = (rootModuleDefinition.findChildDefinition(moduleName, true) != null);
        if (!isPresent) {
            isPresent = rootModuleDefinition.getName().equals(moduleName);
        }
        return isPresent;
    }
View Full Code Here

        }
        return isPresent;
    }

    private RootModuleDefinition rootModuleDefinition() {
        final RootModuleDefinition rootModuleDefinition =
            (moduleStateHolder.getTargetRootModuleDefinition() != null ?
                    moduleStateHolder.getTargetRootModuleDefinition() :
                        moduleStateHolder.getRootModuleDefinition());
                   
        return rootModuleDefinition;
View Full Code Here

    }
   
    protected TransitionResultSet removeModule(ModuleStateHolder moduleStateHolder, Application application,
            ModificationExtractor calculator, String moduleToRemove) {
       
        RootModuleDefinition oldRootDefinition = moduleStateHolder.getRootModuleDefinition();
       
        if (oldRootDefinition == null) {
            return new TransitionResultSet();
        }
       
        RootModuleDefinition newRootDefinition = moduleStateHolder.cloneRootModuleDefinition();
        ModuleDefinition definitionToRemove = newRootDefinition.findChildDefinition(moduleToRemove, true);

        if (definitionToRemove != null) {
            if (definitionToRemove instanceof RootModuleDefinition) {
                //we're removing the rootModuleDefinition
                TransitionSet transitions = calculator.getTransitions(application, oldRootDefinition, null);
View Full Code Here

    }
   
    protected void postProcessBundleContext(BundleContext context) throws Exception {
       
        Impala.init();
        RootModuleDefinition definition = getModuleDefinition();
       
        ServiceReference serviceReference = context.getServiceReference(ModuleDefinitionSource.class.getName());
       
        Object service = context.getService(serviceReference);
       
View Full Code Here

  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);
View Full Code Here

    /**
     * Attempts to reload the root module
     */
    public void reloadRootModule() {
        RootModuleDefinition rootModuleDefinition = getModuleStateHolder().getRootModuleDefinition();
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
                ModuleOperationConstants.CloseRootModuleOperation);
        execute(operation, null);
        ConstructedModuleDefinitionSource newModuleDefinitionSource = new ConstructedModuleDefinitionSource(
                rootModuleDefinition);
View Full Code Here

   
    /**
     * Attempts to repair any modules which are in an error state
     */
    public void repairModules() {
        RootModuleDefinition rootModuleDefinition = getModuleStateHolder().getRootModuleDefinition();
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
                ModuleOperationConstants.RepairModuleOperation);
        ConstructedModuleDefinitionSource newModuleDefinitionSource = new ConstructedModuleDefinitionSource(
                rootModuleDefinition);

View Full Code Here

TOP

Related Classes of org.impalaframework.module.RootModuleDefinition

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.