Package org.apache.geronimo.kernel.config

Examples of org.apache.geronimo.kernel.config.LifecycleResults


        AbstractName storeName = impl.getAbstractName();
        Boolean inPlaceConfiguration = (Boolean) kernel.invoke(storeName, IS_IN_PLACE_CONFIGURATION_METH, new Object[]{previous}, IS_IN_PLACE_CONFIGURATION_SIG);
        commandContext.setInPlace(inPlaceConfiguration.booleanValue());
        doDeploy(target, false);
        Artifact configID = Artifact.create(getResultTargetModuleIDs()[0].getModuleID());
        LifecycleResults results = manager.reloadConfiguration(previous, configID.getVersion());

        // Activate it
        //todo: make this asynchronous
        boolean newStarted = false;
        for (Iterator it = results.getStopped().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Stopped "+name);
        }
        for (Iterator it = results.getUnloaded().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Unloaded "+name);
        }
        for (Iterator it = results.getLoaded().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Loaded "+name);
        }
        for (Iterator it = results.getStarted().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Started "+name);
            if(configID.matches(name)) {
                newStarted = true;
            }
        }
        for (Iterator it = results.getFailed().keySet().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Failed on "+name+": "+results.getFailedCause(name).getMessage());
            doFail((Exception)results.getFailedCause(name));
        }
        if(results.getFailed().size() == 0 && !newStarted) {
            updateStatus("Note: new module was not started (probably because old module was not running).");
        }
    }
View Full Code Here


            } else if (STOP_ACTION.equals(action)) {
                if(configurationManager.isRunning(configId)) {
                    configurationManager.stopConfiguration(configId);
                }
                if(configurationManager.isLoaded(configId)) {
                    LifecycleResults lcresult = configurationManager.unloadConfiguration(configId);
                    message(actionResponse, lcresult, "Stopped application<br /><br />");
                }
            } else if (UNINSTALL_ACTION.equals(action)) {
                configurationManager.uninstallConfiguration(configId);
                message(actionResponse, null, "Uninstalled application<br /><br />"+configId+"<br /><br />");
            } else if (RESTART_ACTION.equals(action)) {
                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                message(actionResponse, lcresult, "Restarted application<br /><br />");
            } else {
                message(actionResponse, null, "Invalid value for changeState: " + action + "<br /><br />");
                throw new PortletException("Invalid value for changeState: " + action);
            }
View Full Code Here

            } else if (STOP_ACTION.equals(action)) {
                if(configurationManager.isRunning(configId)) {
                    configurationManager.stopConfiguration(configId);
                }
                if(configurationManager.isLoaded(configId)) {
                    LifecycleResults lcresult = configurationManager.unloadConfiguration(configId);
                    message(actionResponse, lcresult, "Stopped application<br /><br />");
                }
            } else if (UNINSTALL_ACTION.equals(action)) {
                configurationManager.uninstallConfiguration(configId);
                message(actionResponse, null, "Uninstalled application<br /><br />"+configId+"<br /><br />");
            } else if (RESTART_ACTION.equals(action)) {
                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                message(actionResponse, lcresult, "Restarted application<br /><br />");
            } else {
                message(actionResponse, null, "Invalid value for changeState: " + action + "<br /><br />");
                throw new PortletException("Invalid value for changeState: " + action);
            }
View Full Code Here

        AbstractName storeName = impl.getAbstractName();
        Boolean inPlaceConfiguration = (Boolean) kernel.invoke(storeName, IS_IN_PLACE_CONFIGURATION_METH, new Object[]{previous}, IS_IN_PLACE_CONFIGURATION_SIG);
        commandContext.setInPlace(inPlaceConfiguration.booleanValue());
        doDeploy(target, false);
        Artifact configID = Artifact.create(getResultTargetModuleIDs()[0].getModuleID());
        LifecycleResults results = manager.reloadConfiguration(previous, configID.getVersion());

        // Activate it
        //todo: make this asynchronous
        boolean newStarted = false;
        for (Iterator it = results.getStopped().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Stopped "+name);
        }
        for (Iterator it = results.getUnloaded().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Unloaded "+name);
        }
        for (Iterator it = results.getLoaded().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Loaded "+name);
        }
        for (Iterator it = results.getStarted().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Started "+name);
            if(configID.matches(name)) {
                newStarted = true;
            }
        }
        for (Iterator it = results.getFailed().keySet().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Failed on "+name+": "+results.getFailedCause(name).getMessage());
            doFail((Exception)results.getFailedCause(name));
        }
        if(results.getFailed().size() == 0 && !newStarted) {
            updateStatus("Note: new module was not started (probably because old module was not running).");
        }
    }
View Full Code Here

            } else if (STOP_ACTION.equals(action)) {
                if(configurationManager.isRunning(configId)) {
                    configurationManager.stopConfiguration(configId);
                }
                if(configurationManager.isLoaded(configId)) {
                    LifecycleResults lcresult = configurationManager.unloadConfiguration(configId);
                    message(actionResponse, lcresult, "Stopped application<br /><br />");
                }
            } else if (UNINSTALL_ACTION.equals(action)) {
                configurationManager.uninstallConfiguration(configId);
                message(actionResponse, null, "Uninstalled application<br /><br />"+configId+"<br /><br />");
            } else if (RESTART_ACTION.equals(action)) {
                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                message(actionResponse, lcresult, "Restarted application<br /><br />");
            } else {
                message(actionResponse, null, "Invalid value for changeState: " + action + "<br /><br />");
                throw new PortletException("Invalid value for changeState: " + action);
            }
View Full Code Here

                    org.apache.geronimo.kernel.config.LifecycleResults lcresult = configurationManager.startConfiguration(configId);
                    addInfoMessage(actionRequest, getLocalizedString(actionRequest, "infoMsg01") + printResults(lcresult.getStarted()));
                }
            } else if (STOP_ACTION.equals(action)) {
                if(configurationManager.isLoaded(configId)) {
                    LifecycleResults lcresult = configurationManager.unloadConfiguration(configId);
                    addInfoMessage(actionRequest, getLocalizedString(actionRequest, "infoMsg02") + printResults(lcresult.getStopped()));
                }
            } else if (UNINSTALL_ACTION.equals(action)) {
                configurationManager.uninstallConfiguration(configId);
                addInfoMessage(actionRequest, getLocalizedString(actionRequest, "infoMsg04") + "<br />" + configId);
            } else if (RESTART_ACTION.equals(action)) {
                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                addInfoMessage(actionRequest, getLocalizedString(actionRequest, "infoMsg03") + printResults(lcresult.getStarted()));
            } else {
                addWarningMessage(actionRequest, getLocalizedString(actionRequest, "warnMsg01") + action + "<br />");
                throw new PortletException("Invalid value for changeState: " + action);
            }
        } catch (NoSuchConfigException e) {
View Full Code Here

        AbstractName storeName = impl.getAbstractName();
        Boolean inPlaceConfiguration = (Boolean) kernel.invoke(storeName, IS_IN_PLACE_CONFIGURATION_METH, new Object[]{previous}, IS_IN_PLACE_CONFIGURATION_SIG);
        commandContext.setInPlace(inPlaceConfiguration.booleanValue());
        doDeploy(target, false);
        Artifact configID = Artifact.create(getResultTargetModuleIDs()[0].getModuleID());
        LifecycleResults results = manager.reloadConfiguration(previous, configID.getVersion());

        // Activate it
        //todo: make this asynchronous
        boolean newStarted = false;
        for (Iterator it = results.getStopped().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Stopped "+name);
        }
        for (Iterator it = results.getUnloaded().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Unloaded "+name);
        }
        for (Iterator it = results.getLoaded().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Loaded "+name);
        }
        for (Iterator it = results.getStarted().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Started "+name);
            if(configID.matches(name)) {
                newStarted = true;
            }
        }
        for (Iterator it = results.getFailed().keySet().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Failed on "+name+": "+results.getFailedCause(name).getMessage());
            doFail((Exception)results.getFailedCause(name));
        }
        if(results.getFailed().size() == 0 && !newStarted) {
            updateStatus("Note: new module was not started (probably because old module was not running).");
        }
    }
View Full Code Here

        AbstractName storeName = impl.getAbstractName();
        Boolean inPlaceConfiguration = (Boolean) kernel.invoke(storeName, IS_IN_PLACE_CONFIGURATION_METH, new Object[]{previous}, IS_IN_PLACE_CONFIGURATION_SIG);
        commandContext.setInPlace(inPlaceConfiguration.booleanValue());
        doDeploy(target, false);
        Artifact configID = Artifact.create(getResultTargetModuleIDs()[0].getModuleID());
        LifecycleResults results = manager.reloadConfiguration(previous, configID.getVersion());

        // Activate it
        //todo: make this asynchronous
        boolean newStarted = false;
        for (Iterator it = results.getStopped().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Stopped "+name);
        }
        for (Iterator it = results.getUnloaded().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Unloaded "+name);
        }
        for (Iterator it = results.getLoaded().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Loaded "+name);
        }
        for (Iterator it = results.getStarted().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Started "+name);
            if(configID.matches(name)) {
                newStarted = true;
            }
        }
        for (Iterator it = results.getFailed().keySet().iterator(); it.hasNext();) {
            Artifact name = (Artifact) it.next();
            updateStatus("Failed on "+name+": "+results.getFailedCause(name).getMessage());
            doFail((Exception)results.getFailedCause(name));
        }
        if(results.getFailed().size() == 0 && !newStarted) {
            updateStatus("Note: new module was not started (probably because old module was not running).");
        }
    }
View Full Code Here

        AbstractName storeName = impl.getAbstractName();
        Boolean inPlaceConfiguration = (Boolean) kernel.invoke(storeName, IS_IN_PLACE_CONFIGURATION_METH, new Object[]{previous}, IS_IN_PLACE_CONFIGURATION_SIG);
        commandContext.setInPlace(inPlaceConfiguration.booleanValue());
        doDeploy(target, false);
        Artifact configID = Artifact.create(getResultTargetModuleIDs()[0].getModuleID());
        LifecycleResults results = manager.reloadConfiguration(previous, configID.getVersion());

        // Activate it
        //todo: make this asynchronous
        boolean newStarted = false;
        for (Artifact name : results.getStopped()) {
            updateStatus("Stopped "+name);
        }
        for (Artifact name : results.getUnloaded()) {
            updateStatus("Unloaded "+name);
        }
        for (Artifact name : results.getLoaded()) {
            updateStatus("Loaded "+name);
        }
        for (Artifact name : results.getStarted()) {
            updateStatus("Started "+name);
            if(configID.matches(name)) {
                newStarted = true;
            }
        }
        for(Map.Entry<Artifact, Throwable> entry : results.getFailed().entrySet()) {
            updateStatus("Failed on " + entry.getKey() + ": " + entry.getValue().getMessage());
            doFail(entry.getValue());
        }
        if(results.getFailed().size() == 0 && !newStarted) {
            updateStatus("Note: new module was not started (probably because old module was not running).");
        }
    }
View Full Code Here

        }

        List<Artifact> startedChildren = Collections.<Artifact>emptyList();

        try {
            LifecycleResults  lifecycleResults = configurationManager.stopConfiguration(configID);
            startedChildren = new ArrayList<Artifact>(lifecycleResults.getStopped());
            Collections.reverse(startedChildren);
            updateStatus("Stopped "+configID);
        } catch (InternalKernelException e) {
            Exception cause = (Exception)e.getCause();
            if(cause instanceof NoSuchConfigException) {
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.config.LifecycleResults

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.