Support using the cli.Artemis to boot up a broker without using the boot.Artemis class.

This is handy for when you want to start Artemis in an IDE where it's not in the distro packaging and the classpath is being managed by the IDE.

It just needed to handle using the artemis.instance system prop.
This commit is contained in:
Hiram Chirino 2016-01-06 11:59:56 -05:00
parent bd6cd0d13f
commit 3e6dcd05e1
1 changed files with 14 additions and 1 deletions

View File

@ -40,10 +40,23 @@ import org.apache.activemq.artemis.cli.commands.tools.PrintData;
import org.apache.activemq.artemis.cli.commands.tools.XmlDataExporter;
import org.apache.activemq.artemis.cli.commands.tools.XmlDataImporter;
/**
* Artemis is the main CLI entry point for managing/running a broker.
*
* Want to start or debug a broker from an IDE? This is probably the best class to
* run. Make sure set the -Dartemis.instance=path/to/instance system property.
* You should also use the 'apache-artemis' module for the class path since that
* includes all artemis modules.
*/
public class Artemis {
public static void main(String... args) throws Exception {
execute(null, null, args);
String home = System.getProperty("artemis.home");
File fileHome = home != null ? new File(home) : null;
String instance = System.getProperty("artemis.instance");
File fileInstance = instance != null ? new File(instance) : null;
execute(fileHome, fileInstance, args);
}
public static Object internalExecute(String... args) throws Exception {