Package org.apache.geronimo.deployment

Examples of org.apache.geronimo.deployment.DeploymentException


        public void stop() throws DeploymentException {
            try {
                super.stopKernel();
            } catch(Exception e) {
                throw new DeploymentException("Unable to stop local kernel", e);
            }
        }
View Full Code Here


                "target.  Geronimo does not yet support clusters as targets.");
    }

    public void execute(PrintWriter out, ServerConnection connection, String[] args) throws DeploymentException {
        if(!connection.isOnline()) {
            throw new DeploymentException("This command cannot be run unless connecting to a running server.  Specify --url if server is not running on the default port on localhost.");
        }
        Target[] list = connection.getDeploymentManager().getTargets();
        out.println("Available Targets:");
        for(int i = 0; i < list.length; i++) {
            Target target = list[i];
View Full Code Here

        super(command, group, helpArgumentList, helpText);
    }

    public void execute(PrintWriter out, ServerConnection connection, String[] args) throws DeploymentException {
        if(!connection.isOnline()) {
            throw new DeploymentException("This command cannot be run unless connecting to a running server.  Specify --url if server is not running on the default port on localhost.");
        }
        if(args.length == 0) {
            throw new DeploymentSyntaxException("Must specify at least one module name or TargetModuleID");
        }
        DeploymentManager mgr = connection.getDeploymentManager();
        Target[] allTargets = mgr.getTargets();
        TargetModuleID[] allModules = new TargetModuleID[0];
        try {
            allModules = mgr.getAvailableModules(null, allTargets);
        } catch(TargetException e) {
            throw new DeploymentException("Unable to load module list from server", e);
        }
        List modules = new ArrayList();
        for(int i=0; i<args.length; i++) {
            modules.addAll(identifyTargetModuleIDs(allModules, args[i]));
        }
View Full Code Here

        Target[] tlist = new Target[targetNames.size()];
        Target[] all = mgr.getTargets();
        Set found = new HashSet();
        for (int i = 0; i < tlist.length; i++) {
            if(found.contains(targetNames.get(i))) {
                throw new DeploymentException("Target list should not contain duplicates ("+targetNames.get(i)+")");
            }
            for (int j = 0; j < all.length; j++) {
                Target server = all[j];
                if(server.getName().equals(targetNames.get(i))) {
                    tlist[i] = server;
                    found.add(server.getName());
                    break;
                }
            }
            if(tlist[i] == null) {
                throw new DeploymentException("No target named '"+targetNames.get(i)+"' was found");
            }
        }
        return tlist;
    }
View Full Code Here

            if(allModules[i].getModuleID().equals(name)) {
                list.add(allModules[i]);
            }
        }
        if(list.isEmpty()) {
            throw new DeploymentException(name+" does not appear to be a module name or a TargetModuleID.  For a TargetModuleID, specify it as TargetName|ModuleName");
        }
        return list;
    }
View Full Code Here

                "modules on the specified targets.");
    }

    public void execute(PrintWriter out, ServerConnection connection, String[] args) throws DeploymentException {
        if(!connection.isOnline()) {
            throw new DeploymentException("This command cannot be run unless connecting to a running server.  Specify --url if server is not running on the default port on localhost.");
        }
        List targets = new ArrayList();
        Boolean started = null;
        for (int i = 0; i < args.length; i++) {
            String arg = args[i];
            if(arg.startsWith("--")) {
                if(arg.equals("--all")) {
                    if(started != null) {
                        throw new DeploymentSyntaxException("Cannot specify more than one of --all, --started, --stopped");
                    }
                } else if(arg.equals("--started")) {
                    if(started != null) {
                        throw new DeploymentSyntaxException("Cannot specify more than one of --all, --started, --stopped");
                    }
                    started = Boolean.TRUE;
                } else if(arg.equals("--stopped")) {
                    if(started != null) {
                        throw new DeploymentSyntaxException("Cannot specify more than one of --all, --started, --stopped");
                    }
                    started = Boolean.FALSE;
                } else {
                    throw new DeploymentSyntaxException("Unrecognized option '"+arg+"'");
                }
            } else {
                targets.add(arg);
            }
        }
        final DeploymentManager mgr = connection.getDeploymentManager();
        TargetModuleID[] results;
        Target[] tlist = identifyTargets(targets, mgr);
        if(tlist.length == 0) {
            tlist = mgr.getTargets();
        }
        try {
            if(started == null) {
                results = mgr.getAvailableModules(null, tlist);
            } else if(started.booleanValue()) {
                results = mgr.getRunningModules(null, tlist);
            } else {
                results = mgr.getNonRunningModules(null, tlist);
            }
        } catch (TargetException e) {
            throw new DeploymentException("Unable to query modules", e);
        } catch (IllegalStateException e) {
            throw new DeploymentSyntaxException(e.getMessage());
        }
        if(results == null) {
            results = new TargetModuleID[0];
View Full Code Here

                "Note: To specify a TargetModuleID, use the form TargetName|ModuleName");
    }

    public void execute(PrintWriter out, ServerConnection connection, String[] args) throws DeploymentException {
        if(!connection.isOnline()) {
            throw new DeploymentException("This command cannot be run unless connecting to a running server.  Specify --url if server is not running on the default port on localhost.");
        }
        if(args.length < 2) {
            throw new DeploymentSyntaxException("Must specify a module or plan (or both) and one or more module IDs to replace");
        }
        DeploymentManager mgr = connection.getDeploymentManager();
        Target[] allTargets = mgr.getTargets();
        TargetModuleID[] allModules = new TargetModuleID[0];
        try {
            allModules = mgr.getAvailableModules(null, allTargets);
        } catch(TargetException e) {
            throw new DeploymentException("Unable to load modules from server", e);
        }
        List modules = new ArrayList();
        File module = null;
        File plan = null;
        File test = new File(args[0]);
        if(!test.exists()) {
            throw new DeploymentSyntaxException("Must specify a module or plan (or both) and one or more module IDs to replace");
        }
        if(!test.canRead()) {
            throw new DeploymentException("Cannot read file "+test.getAbsolutePath());
        }
        if(DeployUtils.isJarFile(test) || test.isDirectory()) {
            if(module != null) {
                throw new DeploymentSyntaxException("Module and plan cannot both be JAR files or directories!");
            }
View Full Code Here

        try {
            startedGbeans.add(objectName);
            kernel.loadGBean(objectName, gbean);
            kernel.startGBean(objectName);
        } catch (Exception e) {
            throw new DeploymentException(e);
        }
    }
View Full Code Here

                log.info("Started .. " + objectName);
            } else {
                log.info(objectName + " GBean already started");
            }
        } catch (Exception e) {
            throw new DeploymentException(e);
        }
    }
View Full Code Here

            } else {
                log.info(objectName + " was runing when axis start it "
                        + "Axis will not stop it");
            }
        } catch (Exception e) {
            throw new DeploymentException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.deployment.DeploymentException

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.