Package org.impalaframework.module.spi

Examples of org.impalaframework.module.spi.ModuleStateChange


       
        Collection<ModuleDefinition> childDefinitions = getOldChildDefinitions(definitionToUnload);
        for (ModuleDefinition childDefinition : childDefinitions) {
            unloadDefinitions(childDefinition, transitions);
        }
        ModuleStateChange transition = new ModuleStateChange(Transition.LOADED_TO_UNLOADED, definitionToUnload);
        transitions.add(transition);
        definitionToUnload.setState(ModuleState.UNLOADING);
    }
View Full Code Here


        transitions.add(transition);
        definitionToUnload.setState(ModuleState.UNLOADING);
    }

    protected void loadDefinitions(ModuleDefinition definitionToLoad, List<ModuleStateChange> transitions) {
        ModuleStateChange transition = new ModuleStateChange(Transition.UNLOADED_TO_LOADED, definitionToLoad);
        transitions.add(transition);
        definitionToLoad.setState(ModuleState.LOADING);

        Collection<ModuleDefinition> childDefinitions = getNewChildDefinitions(definitionToLoad);
        for (ModuleDefinition childDefinition : childDefinitions) {
View Full Code Here

        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);
            }
        }
       
        copy.freeze();
View Full Code Here

     * {@link ModuleStateChangeListener#moduleStateChanged(ModuleStateHolder, ModuleStateChange)}
     * should be called.
     */
    public void notify(ModuleStateHolder moduleStateHolder, TransitionResult transitionResult) {
       
        ModuleStateChange moduleStateChange = transitionResult.getModuleStateChange();
       
        ModuleDefinition moduleDefinition = moduleStateChange.getModuleDefinition();

        for (ModuleStateChangeListener moduleStateChangeListener : listeners) {
            String moduleName = moduleStateChangeListener.getModuleName();

            boolean notify = true;

            if (moduleName != null) {
                if (!moduleName.equals(moduleDefinition.getName())) {
                    notify = false;
                }
            }

            if (notify) {

                String transition = moduleStateChangeListener.getTransition();

                if (transition != null) {
                    if (!transition.equals(moduleStateChange.getTransition())) {
                        notify = false;
                    }
                }
            }

View Full Code Here

        StringBuffer buffer = new StringBuffer();
        buffer.append("Module operations succeeded: ").append(resultSet.isSuccess()).append("\n");
        buffer.append("Number of operations: ").append(results.size()).append("\n");
       
        for (TransitionResult transitionResult : results) {
            ModuleStateChange moduleStateChange = transitionResult.getModuleStateChange();
            buffer.append("  ");
            buffer.append(moduleStateChange.getModuleDefinition().getName()).append(": ");
            buffer.append(moduleStateChange.getTransition()).append("\n");
            Throwable error = transitionResult.getError();
            if (error != null) {
                buffer.append("    ");
                buffer.append(error.getClass().getName());
                buffer.append(": ").append(error.getMessage()).append("\n");
View Full Code Here

       
        //newTransitions
        List<ModuleStateChange> newTransitions = new ArrayList<ModuleStateChange>();
       
        for (ModuleDefinition moduleDefinition : unloadable) {
            newTransitions.add(new ModuleStateChange(Transition.LOADED_TO_UNLOADED, moduleDefinition));
        }
       
        //build loadable
        for (ModuleDefinition moduleDefinition : loadable) {
            newTransitions.add(new ModuleStateChange(Transition.UNLOADED_TO_LOADED, moduleDefinition));
        }
       
        //now add other transitions
        for (ModuleStateChange moduleStateChange : transitions) {
            if (!newTransitions.contains(moduleStateChange)) {
View Full Code Here

       
        Collection<ModuleDefinition> childDefinitions = getOldChildDefinitions(definitionToUnload);
        for (ModuleDefinition childDefinition : childDefinitions) {
            unloadDefinitions(childDefinition, transitions);
        }
        ModuleStateChange transition = new ModuleStateChange(Transition.LOADED_TO_UNLOADED, definitionToUnload);
        transitions.add(transition);
        definitionToUnload.setState(ModuleState.UNLOADING);
    }
View Full Code Here

        transitions.add(transition);
        definitionToUnload.setState(ModuleState.UNLOADING);
    }

    protected void loadDefinitions(ModuleDefinition definitionToLoad, List<ModuleStateChange> transitions) {
        ModuleStateChange transition = new ModuleStateChange(Transition.UNLOADED_TO_LOADED, definitionToLoad);
        transitions.add(transition);
        definitionToLoad.setState(ModuleState.LOADING);

        Collection<ModuleDefinition> childDefinitions = getNewChildDefinitions(definitionToLoad);
        for (ModuleDefinition childDefinition : childDefinitions) {
View Full Code Here

        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);
            }
        }
       
        copy.freeze();
View Full Code Here

       
        //newTransitions
        List<ModuleStateChange> newTransitions = new ArrayList<ModuleStateChange>();
       
        for (ModuleDefinition moduleDefinition : unloadable) {
            newTransitions.add(new ModuleStateChange(Transition.LOADED_TO_UNLOADED, moduleDefinition));
        }
       
        //build loadable
        for (ModuleDefinition moduleDefinition : loadable) {
            newTransitions.add(new ModuleStateChange(Transition.UNLOADED_TO_LOADED, moduleDefinition));
        }
       
        //now add other transitions
        for (ModuleStateChange moduleStateChange : transitions) {
            if (!newTransitions.contains(moduleStateChange)) {
View Full Code Here

TOP

Related Classes of org.impalaframework.module.spi.ModuleStateChange

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.