|
ActiveMQ example source code file (ShellCommand.java)
The ActiveMQ ShellCommand.java source code/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.activemq.console.command; import java.io.InputStream; import java.io.PrintStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.activemq.console.CommandContext; import org.apache.activemq.console.command.store.amq.AMQJournalToolCommand; import org.apache.activemq.console.formatter.CommandShellOutputFormatter; public class ShellCommand extends AbstractCommand { private boolean interactive; private String[] helpFile; public ShellCommand() { this(false); } public ShellCommand(boolean interactive) { this.interactive = interactive; this.helpFile = new String[] { interactive ? "Usage: [task] [task-options] [task data]" : "Usage: Main [--extdir <dir>] [task] [task-options] [task data]", "", "Tasks (default task is start):", " start - Creates and starts a broker using a configuration file, or a broker URI.", " create - Creates a runnable broker instance in the specified path", " stop - Stops a running broker specified by the broker name.", " list - Lists all available brokers in the specified JMX context.", " query - Display selected broker component's attributes and statistics.", " browse - Display selected messages in a specified destination.", " journal-audit - Allows you to view records stored in the persistent journal.", " purge - Delete selected destination's messages that matches the message selector", " encrypt - Encrypts given text", " decrypt - Decrypts given text", "", "Task Options (Options specific to each task):", " --extdir <dir> - Add the jar files in the directory to the classpath.", " --version - Display the version information.", " -h,-?,--help - Display this help information. To display task specific help, use " + (interactive ? "" : "Main ") + "[task] -h,-?,--help", "", "Task Data:", " - Information needed by each specific task.", "" }; } /** * Main method to run a command shell client. * * @param args - command line arguments * @param in - input stream to use * @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 Other ActiveMQ examples (source code examples)Here is a short list of links related to this ActiveMQ ShellCommand.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.