Package org.apache.activemq.console

Examples of org.apache.activemq.console.CommandContext


     * (non-Javadoc)
     *
     * @see org.apache.commons.daemon.Daemon#start()
     */
    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


     * (non-Javadoc)
     *
     * @see org.apache.commons.daemon.Daemon#stop()
     */
    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[] {
View Full Code Here

     * @param out - output stream to use
     * @return 0 for a successful run, -1 if there are any exception
     */
    public static int main(String[] args, InputStream in, PrintStream out) {
       
        CommandContext context = new CommandContext();
        context.setFormatter(new CommandShellOutputFormatter(out));

        // Convert arguments to list for easier management
        List<String> tokens = new ArrayList<String>(Arrays.asList(args));

        ShellCommand main = new ShellCommand();
        try {
            main.setCommandContext(context);
            main.execute(tokens);
            return 0;
        } catch (Exception e) {
            context.printException(e);
            return -1;
        }
    }
View Full Code Here

    }

    public void testPurgeCommandSimpleSelector() throws Exception {
        try {
            PurgeCommand purgeCommand = new PurgeCommand();
            CommandContext context = new CommandContext();

            context.setFormatter(new CommandShellOutputFormatter(System.out));

            purgeCommand.setCommandContext(context);
            purgeCommand.setJmxUseLocal(true);

            List<String> tokens = new ArrayList<String>();
View Full Code Here

    }

    public void testPurgeCommandComplexSelector() throws Exception {
        try {
            PurgeCommand purgeCommand = new PurgeCommand();
            CommandContext context = new CommandContext();

            context.setFormatter(new CommandShellOutputFormatter(System.out));

            purgeCommand.setCommandContext(context);
            purgeCommand.setJmxUseLocal(true);

            List<String> tokens = new ArrayList<String>();
View Full Code Here

            } catch (Exception ex) {
                LOG.error(ex.getMessage());
            }

            PurgeCommand purgeCommand = new PurgeCommand();
            CommandContext context = new CommandContext();

            context.setFormatter(new CommandShellOutputFormatter(System.out));

            purgeCommand.setCommandContext(context);
            purgeCommand.setJmxUseLocal(true);

            List<String> tokens = new ArrayList<String>();
View Full Code Here

    }

    public void testPurgeCommandComplexSQLSelector_OR() throws Exception {
        try {
            PurgeCommand purgeCommand = new PurgeCommand();
            CommandContext context = new CommandContext();

            context.setFormatter(new CommandShellOutputFormatter(System.out));

            purgeCommand.setCommandContext(context);
            purgeCommand.setJmxUseLocal(true);

            List<String> tokens = new ArrayList<String>();
View Full Code Here

            } catch (Exception ex) {
                LOG.error(ex.getMessage());
            }

            PurgeCommand purgeCommand = new PurgeCommand();
            CommandContext context = new CommandContext();

            context.setFormatter(new CommandShellOutputFormatter(System.out));

            purgeCommand.setCommandContext(context);
            purgeCommand.setJmxUseLocal(true);

            List<String> tokens = new ArrayList<String>();
View Full Code Here

    super.tearDown();
  }

  public void testNoFactorySet() throws Exception {
    AmqBrowseCommand command = new AmqBrowseCommand();
    CommandContext context = new CommandContext();

    context.setFormatter(new CommandShellOutputFormatter(System.out));

    command.setCommandContext(context);

    List<String> tokens = new ArrayList<String>();
    tokens.addAll(DEFAULT_OPTIONS);
View Full Code Here

    assertNull(command.getPassword());
  }

  public void testUsernamePasswordSet() throws Exception {
    AmqBrowseCommand command = new AmqBrowseCommand();
    CommandContext context = new CommandContext();

    String username = "user";
    String password = "password";

    context.setFormatter(new CommandShellOutputFormatter(System.out));

    command.setCommandContext(context);

    List<String> tokens = new ArrayList<String>();
    tokens.addAll(DEFAULT_OPTIONS);
View Full Code Here

TOP

Related Classes of org.apache.activemq.console.CommandContext

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.