Package org.glite.ce.creamapi.cmdmanagement

Examples of org.glite.ce.creamapi.cmdmanagement.CommandExecutorException


    }

    public void initExecutor() throws CommandExecutorException {
        String cream_sandbox_dir = getParameterValueAsString("CREAM_SANDBOX_DIR");
        if (cream_sandbox_dir == null) {
            throw new CommandExecutorException("parameter \"CREAM_SANDBOX_DIR\" not defined!");
        }
        String sensorHost = getParameterValueAsString(CREAM_JOB_SENSOR_HOST);
        if (sensorHost == null) {
            logger.warn("CREAM_JOB_SENSOR_HOST parameter not specified!");
        }
        File dir = new File(cream_sandbox_dir);

        try {
            if (!dir.exists()) {
                dir.mkdirs();
            }
            makeVODir(dir);
        } catch (IOException ioe) {
            throw new CommandExecutorException(ioe.getMessage());
        } finally {
            dir = null;
        }

        String lbAddress = getParameterValueAsString("LB_DEFAULT_ADDRESS");
View Full Code Here


   
    public void execute(final Command command) throws CommandExecutorException, CommandException {
        logger.debug("BEGIN execute");
       
        if (command == null) {
            throw new CommandExecutorException("command not defined!");
        }

        logger.debug("executing command: " + command.toString());
       
        if (!command.getCategory().equalsIgnoreCase(getCategory())) {
            throw new CommandException("command category mismatch: found \"" + command.getCategory() + "\" required \"" + getCategory() + "\"");
        }

        if (command.isAsynchronous() && command.getCommandGroupId() != null && "COMPOUND".equals(command.getCommandGroupId())) {
            List<String> jobIdList = null;

            if (command.containsParameterKey("JOB_ID_LIST")) {
                jobIdList = command.getParameterMultivalue("JOB_ID_LIST");

                command.deleteParameter("JOB_ID_LIST");
            } else {
                jobIdList = getJobList(command).getJobIdList();
            }

            if (command.containsParameterKey("EXECUTION_MODE")) {
                if (Command.EXECUTION_MODE_SERIAL.equals(command.getParameterAsString("EXECUTION_MODE"))) {
                    command.setExecutionMode(Command.ExecutionModeValues.SERIAL);
                } else {
                    command.setExecutionMode(Command.ExecutionModeValues.PARALLEL);
                }
            }

            if (command.containsParameterKey("PRIORITY_LEVEL")) {
                command.setPriorityLevel(Integer.parseInt(command.getParameterAsString("PRIORITY_LEVEL")));
            }

            if (jobIdList != null) {
                for (String jobId : jobIdList) {
                    command.addParameter("JOB_ID", jobId);
                    command.setCommandGroupId(jobId);

                    try {
                        getCommandManager().execute(command);
                    } catch (CommandManagerException e) {
                        logger.error(e.getMessage());
                        throw new CommandExecutorException(e.getMessage());
                    }
                }
            }

            if (command.getExecutionCompletedTime() == null) {
View Full Code Here

        } catch (CommandException e) {
            logger.error(e.getMessage());
            throw e;
        } catch (Throwable e) {
            logger.error(e.getMessage());
            throw new CommandExecutorException(e);
        }

        logger.debug("END jobRegister");
    }
View Full Code Here

TOP

Related Classes of org.glite.ce.creamapi.cmdmanagement.CommandExecutorException

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.