Package org.apache.activemq.console.command

Examples of org.apache.activemq.console.command.Command


    protected Object doExecute() throws Exception {
        final String[] args = toStringArray(arguments.toArray());

        CommandContext context2 = new CommandContext();
        context2.setFormatter(new CommandShellOutputFormatter(System.out));
        Command currentCommand = command.getClass().newInstance();

        try {
            currentCommand.setCommandContext(context2);
            currentCommand.execute(new ArrayList<String>(Arrays.asList(args)));
            return null;
        } catch (Throwable e) {
            Throwable cur = e;
            while (cur.getCause() != null) {
                cur = cur.getCause();
View Full Code Here


    private Collection<String> arguments;

    protected Object doExecute() throws Exception {
        CommandContext context2 = new CommandContext();
        context2.setFormatter(new CommandShellOutputFormatter(System.out));
        Command currentCommand = command.getClass().newInstance();

        try {
            currentCommand.setCommandContext(context2);
            currentCommand.execute(arguments != null ? new ArrayList<String>(arguments) : new ArrayList<String>());
            return null;
        } catch (Throwable e) {
            Throwable cur = e;
            while (cur.getCause() != null) {
                cur = cur.getCause();
View Full Code Here

     */
    public void start() throws Exception {
        CommandContext context = new CommandContext();
        context.setFormatter(new CommandShellOutputFormatter(System.out));

        Command command = new StartCommand();
        command.setCommandContext(context);

        command.execute(args);
    }
View Full Code Here

     */
    public void stop() throws Exception {
        CommandContext context = new CommandContext();
        context.setFormatter(new CommandShellOutputFormatter(System.out));

        Command command = new ShutdownCommand();
        command.setCommandContext(context);

        List<String> tokens = new ArrayList<String>(Arrays.asList(new String[] {
                "--jmxlocal", "--all", }));

        command.execute(tokens);
    }
View Full Code Here

    private ArrayList<String> arguments = new ArrayList<String>();

    protected Object doExecute() throws Exception {
        CommandContext context2 = new CommandContext();
        context2.setFormatter(new CommandShellOutputFormatter(System.out));
        Command currentCommand = command.getClass().newInstance();

        try {
            currentCommand.setCommandContext(context2);
            // must be added first
            arguments.add(0, "--jmxlocal");
            currentCommand.execute(arguments);
            return null;
        } catch (Throwable e) {
            Throwable cur = e;
            while (cur.getCause() != null) {
                cur = cur.getCause();
View Full Code Here

    private ArrayList<String> arguments = new ArrayList<String>();

    protected Object doExecute() throws Exception {
        CommandContext context2 = new CommandContext();
        context2.setFormatter(new CommandShellOutputFormatter(System.out));
        Command currentCommand = command.getClass().newInstance();

        try {
            currentCommand.setCommandContext(context2);
            arguments.add("--jmxlocal");
            currentCommand.execute(arguments);
            return null;
        } catch (Throwable e) {
            Throwable cur = e;
            while (cur.getCause() != null) {
                cur = cur.getCause();
View Full Code Here

  protected Object doExecute() throws Exception {
    final String[] args = Arguments.toStringArray(arguments.toArray());

    CommandContext context2 = new CommandContext();
    context2.setFormatter(new CommandShellOutputFormatter(io.outputStream));
    Command currentCommand = command.getClass().newInstance();

    try {
        currentCommand.setCommandContext(context2);
        currentCommand.execute(new ArrayList<String>(Arrays.asList(args)));
        return null;
    } catch (Throwable e) {
        Throwable cur = e;
        while (cur.getCause() != null) {
            cur = cur.getCause();
View Full Code Here

    private ArrayList<String> arguments = new ArrayList<String>();

    protected Object doExecute() throws Exception {
        CommandContext context2 = new CommandContext();
        context2.setFormatter(new CommandShellOutputFormatter(System.out));
        Command currentCommand = command.getClass().newInstance();

        try {
            currentCommand.setCommandContext(context2);
            // must be added first
            if (command instanceof AbstractJmxCommand) {
                arguments.add(0, "--jmxlocal");
            }
            currentCommand.execute(arguments);
            return null;
        } catch (Throwable e) {
            Throwable cur = e;
            while (cur.getCause() != null) {
                cur = cur.getCause();
View Full Code Here

     */
    public void start() throws Exception {
        CommandContext context = new CommandContext();
        context.setFormatter(new CommandShellOutputFormatter(System.out));

        Command command = new StartCommand();
        command.setCommandContext(context);

        command.execute(args);
    }
View Full Code Here

     */
    public void stop() throws Exception {
        CommandContext context = new CommandContext();
        context.setFormatter(new CommandShellOutputFormatter(System.out));

        Command command = new ShutdownCommand();
        command.setCommandContext(context);

        List<String> tokens = new ArrayList<String>(Arrays.asList(new String[] {
                "--jmxlocal", "--all", }));

        command.execute(tokens);
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.console.command.Command

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.