Examples of ModuleStateChange


Examples of org.impalaframework.module.spi.ModuleStateChange

       
        //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

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

Examples of org.impalaframework.module.spi.ModuleStateChange

        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

Examples of org.impalaframework.module.spi.ModuleStateChange

        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

Examples of org.impalaframework.module.spi.ModuleStateChange

       
        //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

Examples of org.impalaframework.module.spi.ModuleStateChange

       
        ModuleStateChangeListener listener = creator.newModuleStateChangeListener("myServlet");

        replayMocks();
       
        ModuleStateChange moduleStateChange = new ModuleStateChange(Transition.UNLOADED_TO_LOADED, new SimpleModuleDefinition("myModule"));
        TransitionResult transitionResult = new TransitionResult(moduleStateChange);
       
        try {
            listener.moduleStateChanged(createMock(ModuleStateHolder.class),transitionResult);
            fail();
View Full Code Here

Examples of org.impalaframework.module.spi.ModuleStateChange

       
        ModuleStateChangeListener listener = creator.newModuleStateChangeListener("myServlet");

        replayMocks();
       
        ModuleStateChange moduleStateChange = new ModuleStateChange(Transition.UNLOADED_TO_LOADED, new SimpleModuleDefinition("myModule"));
        TransitionResult transitionResult = new TransitionResult(moduleStateChange, new RuntimeException());
       
        listener.moduleStateChanged(createMock(ModuleStateHolder.class),transitionResult);
       
        verifyMocks();
View Full Code Here

Examples of org.impalaframework.module.spi.ModuleStateChange

    public void testLoadRoot() {
       
        RootModuleDefinition rootModuleDefinition = newTest1().getModuleDefinition();
        rootModuleDefinition.freeze();
       
        ModuleStateChange moduleStateChange = new ModuleStateChange(Transition.UNLOADED_TO_LOADED, rootModuleDefinition);
       
        //expectations (round 1 - loading of parent)
        expect(moduleRuntimeManager.initModule(application, rootModuleDefinition)).andReturn(true);
       
        replayMocks();
View Full Code Here

Examples of org.impalaframework.module.spi.ModuleStateChange

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        notifier = new DefaultModuleStateChangeNotifier();
        change = new ModuleStateChange(Transition.UNLOADED_TO_LOADED, new SimpleModuleDefinition("myModule"));
        List<ModuleStateChangeListener> listeners = new ArrayList<ModuleStateChangeListener>();
        listener1 = createMock(ModuleStateChangeListener.class);
        listener2 = createMock(ModuleStateChangeListener.class);
        listener3 = createMock(ModuleStateChangeListener.class);
        listener4 = createMock(ModuleStateChangeListener.class);
View Full Code Here

Examples of org.impalaframework.module.spi.ModuleStateChange

        transitionManager.processTransitions(moduleStateHolder, application, transitionSet);
    }
   
    private TransitionResultSet newTransitionResultSet() {
        TransitionResultSet result = new TransitionResultSet();
        ModuleStateChange stateChange = new ModuleStateChange(Transition.LOADED_TO_UNLOADED, new SimpleModuleDefinition("myModule"));
        result.addResult(new TransitionResult(stateChange));
        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.