Package org.apache.geronimo.kernel.config

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


                }

            } else if (STOP_ACTION.equals(action)) {

                if(configurationManager.isLoaded(configId)) {
                    LifecycleResults lcresult = configurationManager.unloadConfiguration(configId);
                    addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg02") + printResults(lcresult.getStopped()));
                }

            } else if (UNINSTALL_ACTION.equals(action)) {

                configurationManager.uninstallConfiguration(configId);

                addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg04") + "<br />" + configId);

            } else if (RESTART_ACTION.equals(action)) {

                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg03") + printResults(lcresult.getStarted()));

            } else {
                addWarningMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.warnMsg01") + action + "<br />");
                throw new PortletException("Invalid value for changeState: " + action);
            }
View Full Code Here


                }

            } else if (STOP_ACTION.equals(action)) {

                if(configurationManager.isLoaded(configId)) {
                    LifecycleResults lcresult = configurationManager.unloadConfiguration(configId);
                    addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg02") + printResults(lcresult.getStopped()));
                }

            } else if (UNINSTALL_ACTION.equals(action)) {

                configurationManager.uninstallConfiguration(configId);

                addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg04") + "<br />" + configId);

            } else if (RESTART_ACTION.equals(action)) {

                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg03") + printResults(lcresult.getStarted()));

            } else {
                addWarningMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.warnMsg01") + action + "<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);
                    messageStatus = "Stopped application<br /><br />";
                    this.printResults(lcresult.getUnloaded(), action);
                }
            } else if (UNINSTALL_ACTION.equals(action)) {
                configurationManager.uninstallConfiguration(configId);
                messageStatus = "Uninstalled application<br /><br />"+configId+"<br /><br />";               
            } else if (RESTART_ACTION.equals(action)) {
                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                messageStatus = "Restarted application<br /><br />";
                this.printResults(lcresult.getStarted(), START_ACTION);
            } else {
                messageStatus = "Invalid value for changeState: " + action + "<br /><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

            } else if (STOP_ACTION.equals(action)) {
                if(configurationManager.isRunning(configId)) {
                    configurationManager.stopConfiguration(configId);
                }
                if(configurationManager.isLoaded(configId)) {
                    LifecycleResults lcresult = configurationManager.unloadConfiguration(configId);
                    messageStatus = "Stopped application<br /><br />";
                    this.printResults(lcresult.getUnloaded(), action);
                }
            } else if (UNINSTALL_ACTION.equals(action)) {
                configurationManager.uninstallConfiguration(configId);
                messageStatus = "Uninstalled application<br /><br />"+configId+"<br /><br />";               
            } else if (RESTART_ACTION.equals(action)) {
                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                messageStatus = "Restarted application<br /><br />";
                this.printResults(lcresult.getStarted(), START_ACTION);
            } else {
                messageStatus = "Invalid value for changeState: " + action + "<br /><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 (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

                    org.apache.geronimo.kernel.config.LifecycleResults lcresult = configurationManager.startConfiguration(configId);
                    addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg01") + printResults(lcresult.getStarted()));
                }
            } else if (STOP_ACTION.equals(action)) {
                if(configurationManager.isLoaded(configId)) {
                    LifecycleResults lcresult = configurationManager.unloadConfiguration(configId);
                    addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg02") + printResults(lcresult.getStopped()));
                }
            } else if (UNINSTALL_ACTION.equals(action)) {
                configurationManager.uninstallConfiguration(configId);
                addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg04") + "<br />" + configId);
            } else if (RESTART_ACTION.equals(action)) {
                LifecycleResults lcresult = configurationManager.restartConfiguration(configId);
                addInfoMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.infoMsg03") + printResults(lcresult.getStarted()));
            } else {
                addWarningMessage(actionRequest, getLocalizedString(actionRequest, "consolebase.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

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.