Package org.impalaframework.module.definition

Examples of org.impalaframework.module.definition.DependencyManager


    public TransitionSet getTransitions(Application application, RootModuleDefinition originalDefinition, RootModuleDefinition newDefinition) {

        List<ModuleStateChange> transitions = new ArrayList<ModuleStateChange>();
       
        RootModuleDefinition copy = ModuleDefinitionUtils.cloneAndUnfreeze(originalDefinition);
        DependencyManager dependencyManager = new DependencyManager(copy);
        Collection<ModuleDefinition> sortedModules = dependencyManager.getAllModules();
       
        for (ModuleDefinition moduleDefinition : sortedModules) {
            if (ModuleState.ERROR.equals(moduleDefinition.getState()) || ModuleState.DEPENDENCY_FAILED.equals(moduleDefinition.getState())) {
                transitions.add(new ModuleStateChange(Transition.UNLOADED_TO_LOADED, moduleDefinition));
                moduleDefinition.setState(ModuleState.LOADING);
View Full Code Here


        if (originalDefinition == null && newDefinition == null) {
            throw new IllegalArgumentException("Either originalDefinition or newDefinition must be non-null");
        }
       
        if (originalDefinition != null) {
            oldDependencyManager = new DependencyManager(originalDefinition);
        }
       
        if (newDefinition != null) {
            newDependencyManager = new DependencyManager(newDefinition);
        }
       
        //get the transitions from the superclass hierarchy
        super.populateTransitions(transitions, originalDefinition, newDefinition);
View Full Code Here

    protected List<ApplicationContext> getDependentApplicationContexts(
            ModuleDefinition definition,
            GraphModuleStateHolder graphModuleStateHolder) {
       
        DependencyManager dependencyManager = graphModuleStateHolder.getDependencyManager();
       
        //get the dependencies in correct order
        final List<ModuleDefinition> dependencies = dependencyManager.getOrderedModuleDependencies(definition.getName());  
       
        //remove the current definition from this list
        dependencies.remove(definition);
       
        final List<ApplicationContext> applicationContexts = new ArrayList<ApplicationContext>();
View Full Code Here

    public TransitionSet getTransitions(RootModuleDefinition originalDefinition, RootModuleDefinition newDefinition) {

        List<ModuleStateChange> transitions = new ArrayList<ModuleStateChange>();
       
        RootModuleDefinition copy = ModuleDefinitionUtils.cloneAndUnfreeze(originalDefinition);
        DependencyManager dependencyManager = new DependencyManager(copy);
        Collection<ModuleDefinition> sortedModules = dependencyManager.getAllModules();
       
        for (ModuleDefinition moduleDefinition : sortedModules) {
            if (ModuleState.ERROR.equals(moduleDefinition.getState()) || ModuleState.DEPENDENCY_FAILED.equals(moduleDefinition.getState())) {
                transitions.add(new ModuleStateChange(Transition.UNLOADED_TO_LOADED, moduleDefinition));
                moduleDefinition.setState(ModuleState.LOADING);
View Full Code Here

        if (originalDefinition == null && newDefinition == null) {
            throw new IllegalArgumentException("Either originalDefinition or newDefinition must be non-null");
        }
       
        if (originalDefinition != null) {
            oldDependencyManager = new DependencyManager(originalDefinition);
        }
       
        if (newDefinition != null) {
            newDependencyManager = new DependencyManager(newDefinition);
        }
       
        //get the transitions from the superclass hierarchy
        super.populateTransitions(transitions, originalDefinition, newDefinition);
View Full Code Here

        ModuleLocationResolver resolver = new StandaloneModuleLocationResolver();
        InternalModuleDefinitionSource source = new InternalModuleDefinitionSource(typeReaderRegistry, resolver, new String[]{"impala-core", "sample-module4", "sample-module6"});

        RootModuleDefinition rootDefinition = source.getModuleDefinition();
       
        DependencyManager dependencyManager = new DependencyManager(rootDefinition);
        GraphClassLoaderFactory factory = new GraphClassLoaderFactory();
        factory.setModuleLocationResolver(resolver);
       
        GraphClassLoader rootClassLoader = factory.newClassLoader(new GraphClassLoaderRegistry(), dependencyManager, rootDefinition);
        return rootClassLoader;
View Full Code Here

        if (classLoaderRegistry.getApplicationClassLoader() == null) {
            classLoaderRegistry.setApplicationClassLoader(parent);
        }
       
        Assert.notNull(moduleDefinition, "moduleDefinition cannot be null");
        DependencyManager newDependencyManager = moduleStateHolder.getDependencyManager();
       
        Assert.notNull(newDependencyManager, "new dependency manager not available. Cannot create graph based class loader");
       
        return newClassLoader(newDependencyManager, moduleDefinition);
    }
View Full Code Here

            GraphModuleStateHolder graphModuleStateHolder);

    protected List<ApplicationContext> getDependentApplicationContexts(
            ModuleDefinition definition,
            GraphModuleStateHolder graphModuleStateHolder) {
        DependencyManager dependencyManager = graphModuleStateHolder.getDependencyManager();
       
        //get the dependencies in correct order
        final List<ModuleDefinition> dependencies = dependencyManager.getOrderedModuleDependencies(definition.getName());  
       
        //remove the current definition from this list
        dependencies.remove(definition);
       
        final List<ApplicationContext> applicationContexts = new ArrayList<ApplicationContext>();
View Full Code Here

        ModuleLocationResolver resolver = new StandaloneModuleLocationResolver();
        InternalModuleDefinitionSource source = new InternalModuleDefinitionSource(typeReaderRegistry, resolver, new String[]{"impala-core", "sample-module4", "sample-module6"});

        RootModuleDefinition rootDefinition = source.getModuleDefinition();
       
        DependencyManager dependencyManager = new DependencyManager(rootDefinition);
        GraphClassLoaderFactory factory = new GraphClassLoaderFactory();
        factory.setModuleLocationResolver(resolver);
       
        GraphClassLoader rootClassLoader = factory.newClassLoader(classLoaderRegistry, dependencyManager, rootDefinition);
       
View Full Code Here

        newDefinition(definitions, "c");
        newDefinition(definitions, "d", "b");
        newDefinition(definitions, "e", "c,d");
        newDefinition(definitions, "f", "b,e");
        g = newDefinition(definitions, "g", "c,d,f");
        dependencyManager = new DependencyManager(definitions);
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.module.definition.DependencyManager

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.