renamed startup scripts
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/34f8e538 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/34f8e538 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/34f8e538 Branch: refs/heads/master Commit: 34f8e5383da582bc70c1f425f093928a5b1694f6 Parents: 24a4c63 Author: Andy Taylor <[email protected]> Authored: Wed Apr 29 14:28:11 2015 +0100 Committer: Andy Taylor <[email protected]> Committed: Wed Apr 29 14:28:11 2015 +0100 ---------------------------------------------------------------------- .../apache/activemq/artemis/boot/ActiveMQ.java | 136 ---------------- .../apache/activemq/artemis/boot/Artemis.java | 136 ++++++++++++++++ .../apache/activemq/artemis/cli/ActiveMQ.java | 92 ----------- .../apache/activemq/artemis/cli/Artemis.java | 92 +++++++++++ .../activemq/artemis/cli/commands/Create.java | 34 ++-- .../activemq/artemis/cli/commands/Run.java | 18 +-- .../activemq/artemis/cli/commands/Stop.java | 12 +- .../activemq/artemis/cli/commands/bin/activemq | 119 -------------- .../artemis/cli/commands/bin/activemq-service | 154 ------------------- .../cli/commands/bin/activemq-service.xml | 59 ------- .../artemis/cli/commands/bin/activemq.cmd | 76 --------- .../activemq/artemis/cli/commands/bin/artemis | 119 ++++++++++++++ .../artemis/cli/commands/bin/artemis-service | 154 +++++++++++++++++++ .../cli/commands/bin/artemis-service.xml | 59 +++++++ .../artemis/cli/commands/bin/artemis.cmd | 76 +++++++++ .../artemis/cli/commands/etc/activemq.profile | 27 ---- .../cli/commands/etc/activemq.profile.cmd | 27 ---- .../artemis/cli/commands/etc/artemis.profile | 27 ++++ .../cli/commands/etc/artemis.profile.cmd | 27 ++++ .../artemis/cli/commands/etc/bootstrap.xml | 6 +- .../artemis/cli/commands/etc/logging.properties | 2 +- .../xa/ActiveMQXAResourceWrapperImplTest.java | 2 +- .../src/main/resources/examples/index.html | 2 +- .../artemis/src/main/resources/bin/activemq | 108 ------------- .../artemis/src/main/resources/bin/activemq.cmd | 66 -------- .../artemis/src/main/resources/bin/artemis | 108 +++++++++++++ .../artemis/src/main/resources/bin/artemis.cmd | 66 ++++++++ docs/quickstart-guide/en/running.md | 4 +- docs/user-manual/en/using-server.md | 6 +- 29 files changed, 907 insertions(+), 907 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/ActiveMQ.java ---------------------------------------------------------------------- diff --git a/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/ActiveMQ.java b/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/ActiveMQ.java deleted file mode 100644 index 5182c54..0000000 --- a/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/ActiveMQ.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * 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.artemis.boot; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; - -/** - * <p> - * A main class which setups up a classpath and then passes - * execution off to the ActiveMQ cli main. - * </p> - */ -public class ActiveMQ -{ - - public static void main(String[] args) throws Throwable - { - ArrayList<File> dirs = new ArrayList<File>(); - String instance = System.getProperty("activemq.instance"); - if (instance != null) - { - dirs.add(new File(new File(instance), "lib")); - } - - String home = System.getProperty("activemq.home"); - if (home != null) - { - dirs.add(new File(new File(home), "lib")); - } - - ArrayList<URL> urls = new ArrayList<URL>(); - for (File bootdir : dirs) - { - if (bootdir.exists() && bootdir.isDirectory()) - { - - // Find the jar files in the directory.. - ArrayList<File> files = new ArrayList<File>(); - for (File f : bootdir.listFiles()) - { - if (f.getName().endsWith(".jar") || f.getName().endsWith(".zip")) - { - files.add(f); - } - } - - // Sort the list by file name.. - Collections.sort(files, new Comparator<File>() - { - public int compare(File file, File file1) - { - return file.getName().compareTo(file1.getName()); - } - }); - - for (File f : files) - { - add(urls, f); - } - - } - } - - if (instance != null) - { - System.setProperty("java.io.tmpdir", new File(new File(instance), "tmp").getCanonicalPath()); - } - - // Lets try to covert the logging.configuration setting to a valid URI - String loggingConfig = System.getProperty("logging.configuration"); - if (loggingConfig != null) - { - System.setProperty("logging.configuration", fixupFileURI(loggingConfig)); - } - - // Now setup our classloader.. - URLClassLoader loader = new URLClassLoader(urls.toArray(new URL[urls.size()])); - Thread.currentThread().setContextClassLoader(loader); - Class<?> clazz = loader.loadClass("org.apache.activemq.artemis.cli.ActiveMQ"); - Method method = clazz.getMethod("main", args.getClass()); - try - { - method.invoke(null, (Object) args); - } - catch (InvocationTargetException e) - { - throw e.getTargetException(); - } - - } - - static String fixupFileURI(String value) - { - if (value != null && value.startsWith("file:")) - { - value = value.substring("file:".length()); - value = new File(value).toURI().toString(); - } - return value; - } - - private static void add(ArrayList<URL> urls, File file) - { - try - { - urls.add(file.toURI().toURL()); - } - catch (MalformedURLException e) - { - e.printStackTrace(); - } - } - -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java ---------------------------------------------------------------------- diff --git a/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java b/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java new file mode 100644 index 0000000..bf83100 --- /dev/null +++ b/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java @@ -0,0 +1,136 @@ +/** + * 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.artemis.boot; + +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; + +/** + * <p> + * A main class which setups up a classpath and then passes + * execution off to the ActiveMQ cli main. + * </p> + */ +public class Artemis +{ + + public static void main(String[] args) throws Throwable + { + ArrayList<File> dirs = new ArrayList<File>(); + String instance = System.getProperty("artemis.instance"); + if (instance != null) + { + dirs.add(new File(new File(instance), "lib")); + } + + String home = System.getProperty("artemis.home"); + if (home != null) + { + dirs.add(new File(new File(home), "lib")); + } + + ArrayList<URL> urls = new ArrayList<URL>(); + for (File bootdir : dirs) + { + if (bootdir.exists() && bootdir.isDirectory()) + { + + // Find the jar files in the directory.. + ArrayList<File> files = new ArrayList<File>(); + for (File f : bootdir.listFiles()) + { + if (f.getName().endsWith(".jar") || f.getName().endsWith(".zip")) + { + files.add(f); + } + } + + // Sort the list by file name.. + Collections.sort(files, new Comparator<File>() + { + public int compare(File file, File file1) + { + return file.getName().compareTo(file1.getName()); + } + }); + + for (File f : files) + { + add(urls, f); + } + + } + } + + if (instance != null) + { + System.setProperty("java.io.tmpdir", new File(new File(instance), "tmp").getCanonicalPath()); + } + + // Lets try to covert the logging.configuration setting to a valid URI + String loggingConfig = System.getProperty("logging.configuration"); + if (loggingConfig != null) + { + System.setProperty("logging.configuration", fixupFileURI(loggingConfig)); + } + + // Now setup our classloader.. + URLClassLoader loader = new URLClassLoader(urls.toArray(new URL[urls.size()])); + Thread.currentThread().setContextClassLoader(loader); + Class<?> clazz = loader.loadClass("org.apache.activemq.artemis.cli.Artemis"); + Method method = clazz.getMethod("main", args.getClass()); + try + { + method.invoke(null, (Object) args); + } + catch (InvocationTargetException e) + { + throw e.getTargetException(); + } + + } + + static String fixupFileURI(String value) + { + if (value != null && value.startsWith("file:")) + { + value = value.substring("file:".length()); + value = new File(value).toURI().toString(); + } + return value; + } + + private static void add(ArrayList<URL> urls, File file) + { + try + { + urls.add(file.toURI().toURL()); + } + catch (MalformedURLException e) + { + e.printStackTrace(); + } + } + +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/ActiveMQ.java ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/ActiveMQ.java b/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/ActiveMQ.java deleted file mode 100644 index 194ad44..0000000 --- a/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/ActiveMQ.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * 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.artemis.cli; - -import io.airlift.command.Cli; -import io.airlift.command.ParseArgumentsUnexpectedException; -import org.apache.activemq.artemis.cli.commands.Action; -import org.apache.activemq.artemis.cli.commands.ActionContext; -import org.apache.activemq.artemis.cli.commands.Create; -import org.apache.activemq.artemis.cli.commands.HelpAction; -import org.apache.activemq.artemis.cli.commands.Run; -import org.apache.activemq.artemis.cli.commands.Stop; - -import java.io.InputStream; -import java.io.OutputStream; - -public class ActiveMQ -{ - - public static void main(String[] args) throws Exception - { - String instance = System.getProperty("activemq.instance"); - Cli.CliBuilder<Action> builder = Cli.<Action>builder("activemq") - .withDescription("ActiveMQ Command Line") - .withCommand(HelpAction.class) - .withDefaultCommand(HelpAction.class); - - if (instance != null) - { - builder = builder - .withCommand(Run.class) - .withCommand(Stop.class); - } - else - { - builder = builder - .withCommand(Create.class); - } - - - Cli<Action> parser = builder.build(); - try - { - parser.parse(args).execute(ActionContext.system()); - } - catch (ParseArgumentsUnexpectedException e) - { - System.err.println(e.getMessage()); - System.out.println(); - parser.parse("help").execute(ActionContext.system()); - } - catch (ConfigurationException configException) - { - System.err.println(configException.getMessage()); - System.out.println(); - System.out.println("Configuration should be specified as 'scheme:location'. Default configuration is 'xml:${ACTIVEMQ_INSTANCE}/etc/bootstrap.xml'"); - } - - } - - public static void printBanner() throws Exception - { - copy(ActiveMQ.class.getResourceAsStream("banner.txt"), System.out); - } - - private static long copy(InputStream in, OutputStream out) throws Exception - { - byte[] buffer = new byte[1024]; - int len = in.read(buffer); - while (len != -1) - { - out.write(buffer, 0, len); - len = in.read(buffer); - } - return len; - } - -} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/Artemis.java ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/Artemis.java b/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/Artemis.java new file mode 100644 index 0000000..1b747c5 --- /dev/null +++ b/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/Artemis.java @@ -0,0 +1,92 @@ +/** + * 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.artemis.cli; + +import io.airlift.command.Cli; +import io.airlift.command.ParseArgumentsUnexpectedException; +import org.apache.activemq.artemis.cli.commands.Action; +import org.apache.activemq.artemis.cli.commands.ActionContext; +import org.apache.activemq.artemis.cli.commands.Create; +import org.apache.activemq.artemis.cli.commands.HelpAction; +import org.apache.activemq.artemis.cli.commands.Run; +import org.apache.activemq.artemis.cli.commands.Stop; + +import java.io.InputStream; +import java.io.OutputStream; + +public class Artemis +{ + + public static void main(String[] args) throws Exception + { + String instance = System.getProperty("artemis.instance"); + Cli.CliBuilder<Action> builder = Cli.<Action>builder("artemis") + .withDescription("ActiveMQ Artemis Command Line") + .withCommand(HelpAction.class) + .withDefaultCommand(HelpAction.class); + + if (instance != null) + { + builder = builder + .withCommand(Run.class) + .withCommand(Stop.class); + } + else + { + builder = builder + .withCommand(Create.class); + } + + + Cli<Action> parser = builder.build(); + try + { + parser.parse(args).execute(ActionContext.system()); + } + catch (ParseArgumentsUnexpectedException e) + { + System.err.println(e.getMessage()); + System.out.println(); + parser.parse("help").execute(ActionContext.system()); + } + catch (ConfigurationException configException) + { + System.err.println(configException.getMessage()); + System.out.println(); + System.out.println("Configuration should be specified as 'scheme:location'. Default configuration is 'xml:${ARTEMIS_INSTANCE}/etc/bootstrap.xml'"); + } + + } + + public static void printBanner() throws Exception + { + copy(Artemis.class.getResourceAsStream("banner.txt"), System.out); + } + + private static long copy(InputStream in, OutputStream out) throws Exception + { + byte[] buffer = new byte[1024]; + int len = in.read(buffer); + while (len != -1) + { + out.write(buffer, 0, len); + len = in.read(buffer); + } + return len; + } + +} http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java index 22cc10e..8131668 100644 --- a/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java +++ b/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java @@ -44,7 +44,7 @@ public class Create implements Action @Option(name = "--force", description = "Overwrite configuration at destination directory") boolean force; - @Option(name = "--home", description = "Directory where ActiveMQ is installed") + @Option(name = "--home", description = "Directory where ActiveMQ Artemis is installed") File home; @Option(name = "--with-ssl", description = "Generate an SSL enabled configuration") @@ -91,7 +91,7 @@ public class Create implements Action } - context.out.println(String.format("Creating ActiveMQ instance at: %s", directory.getCanonicalPath())); + context.out.println(String.format("Creating ActiveMQ Artemis instance at: %s", directory.getCanonicalPath())); if (host == null) { host = directory.getName(); @@ -128,8 +128,8 @@ public class Create implements Action { filters.put("${home}", path(home, false)); } - filters.put("${activemq.home}", path(System.getProperty("activemq.home"), false)); - filters.put("${activemq.instance}", path(directory, false)); + filters.put("${artemis.home}", path(System.getProperty("artemis.home"), false)); + filters.put("${artemis.instance}", path(directory, false)); filters.put("${java.home}", path(System.getProperty("java.home"), false)); new File(directory, "bin").mkdirs(); @@ -141,20 +141,20 @@ public class Create implements Action if (IS_WINDOWS) { - write("bin/activemq.cmd", null, false); - write("bin/activemq-service.exe"); - write("bin/activemq-service.xml", filters, false); - write("etc/activemq.profile.cmd", filters, false); + write("bin/artemis.cmd", null, false); + write("bin/artemis-service.exe"); + write("bin/artemis-service.xml", filters, false); + write("etc/artemis.profile.cmd", filters, false); } if (!IS_WINDOWS || IS_CYGWIN) { - write("bin/activemq", null, true); - makeExec("bin/activemq"); - write("bin/activemq-service", null, true); - makeExec("bin/activemq-service"); - write("etc/activemq.profile", filters, true); - makeExec("etc/activemq.profile"); + write("bin/artemis", null, true); + makeExec("bin/artemis"); + write("bin/artemis-service", null, true); + makeExec("bin/artemis-service"); + write("etc/artemis.profile", filters, true); + makeExec("etc/artemis.profile"); } write("etc/logging.properties", null, false); @@ -166,9 +166,9 @@ public class Create implements Action context.out.println(""); context.out.println("You can now start the broker by executing: "); context.out.println(""); - context.out.println(String.format(" \"%s\" run", path(new File(directory, "bin/activemq"), true))); + context.out.println(String.format(" \"%s\" run", path(new File(directory, "bin/artemis"), true))); - File service = new File(directory, "bin/activemq-service"); + File service = new File(directory, "bin/artemis-service"); context.out.println(""); if (!IS_WINDOWS || IS_CYGWIN) @@ -180,7 +180,7 @@ public class Create implements Action context.out.println("Or you can setup the broker as system service and run it in the background:"); context.out.println(""); context.out.println(" sudo ln -s \"%s\" /etc/init.d/".format(service.getCanonicalPath())); - context.out.println(" /etc/init.d/activemq-service start"); + context.out.println(" /etc/init.d/artemis-service start"); context.out.println(""); } http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java b/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java index a8e505c..360ed3b 100644 --- a/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java +++ b/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java @@ -19,7 +19,7 @@ package org.apache.activemq.artemis.cli.commands; import io.airlift.command.Arguments; import io.airlift.command.Command; -import org.apache.activemq.artemis.cli.ActiveMQ; +import org.apache.activemq.artemis.cli.Artemis; import org.apache.activemq.artemis.components.ExternalComponent; import org.apache.activemq.artemis.core.server.ActiveMQComponent; import org.apache.activemq.artemis.dto.BrokerDTO; @@ -40,7 +40,7 @@ import java.util.TimerTask; public class Run implements Action { - @Arguments(description = "Broker Configuration URI, default 'xml:${ACTIVEMQ_INSTANCE}/etc/bootstrap.xml'") + @Arguments(description = "Broker Configuration URI, default 'xml:${ARTEMIS_INSTANCE}/etc/bootstrap.xml'") String configuration; private ArrayList<ActiveMQComponent> components = new ArrayList<>(); @@ -60,13 +60,13 @@ public class Run implements Action public Object execute(ActionContext context) throws Exception { - ActiveMQ.printBanner(); + Artemis.printBanner(); - /* We use File URI for locating files. The ACTIVEMQ_HOME variable is used to determine file paths. For Windows - the ACTIVEMQ_HOME variable will include back slashes (An invalid file URI character path separator). For this - reason we overwrite the ACTIVEMQ_HOME variable with backslashes replaced with forward slashes. */ - String activemqInstance = System.getProperty("activemq.instance").replace("\\", "/"); - System.setProperty("activemq.instance", activemqInstance); + /* We use File URI for locating files. The ARTEMIS_HOME variable is used to determine file paths. For Windows + the ARTEMIS_HOME variable will include back slashes (An invalid file URI character path separator). For this + reason we overwrite the ARTEMIS_HOME variable with backslashes replaced with forward slashes. */ + String activemqInstance = System.getProperty("artemis.instance").replace("\\", "/"); + System.setProperty("artemis.instance", activemqInstance); if (configuration == null) { @@ -120,7 +120,7 @@ public class Run implements Action ActiveMQBootstrapLogger.LOGGER.errorDeletingFile(file.getAbsolutePath()); } } - final Timer timer = new Timer("ActiveMQ Server Shutdown Timer", true); + final Timer timer = new Timer("ActiveMQ Artemis Server Shutdown Timer", true); timer.scheduleAtFixedRate(new TimerTask() { @Override http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Stop.java ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Stop.java b/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Stop.java index 0c4028c..90cddb3 100644 --- a/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Stop.java +++ b/artemis-bootstrap/src/main/java/org/apache/activemq/artemis/cli/commands/Stop.java @@ -27,17 +27,17 @@ import java.net.URI; @Command(name = "stop", description = "stops the broker instance") public class Stop implements Action { - @Arguments(description = "Broker Configuration URI, default 'xml:${ACTIVEMQ_INSTANCE}/etc/bootstrap.xml'") + @Arguments(description = "Broker Configuration URI, default 'xml:${ARTEMIS_INSTANCE}/etc/bootstrap.xml'") String configuration; @Override public Object execute(ActionContext context) throws Exception { - /* We use File URI for locating files. The ACTIVEMQ_HOME variable is used to determine file paths. For Windows - the ACTIVEMQ_HOME variable will include back slashes (An invalid file URI character path separator). For this - reason we overwrite the ACTIVEMQ_HOME variable with backslashes replaced with forward slashes. */ - String activemqHome = System.getProperty("activemq.instance").replace("\\", "/"); - System.setProperty("activemq.instance", activemqHome); + /* We use File URI for locating files. The ARTEMIS_HOME variable is used to determine file paths. For Windows + the ARTEMIS_HOME variable will include back slashes (An invalid file URI character path separator). For this + reason we overwrite the ARTEMIS_HOME variable with backslashes replaced with forward slashes. */ + String activemqHome = System.getProperty("artemis.instance").replace("\\", "/"); + System.setProperty("artemis.instance", activemqHome); if (configuration == null) { http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq deleted file mode 100755 index c72af5b..0000000 --- a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh -# 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. - -if [ -z "$ACTIVEMQ_INSTANCE" ] ; then - - ## resolve links - $0 may be a link to ActiveMQ's home - PRG="$0" - progname=`basename "$0"` - saveddir=`pwd` - - # need this for relative symlinks - dirname_prg=`dirname "$PRG"` - cd "$dirname_prg" - - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '.*/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi - done - - ACTIVEMQ_INSTANCE=`dirname "$PRG"` - cd "$saveddir" - - # make it fully qualified - ACTIVEMQ_INSTANCE=`cd "$ACTIVEMQ_INSTANCE/.." && pwd` -fi - -# Set Defaults Properties -ACTIVEMQ_LOGGING_CONF="file:$ACTIVEMQ_INSTANCE/etc/logging.properties" -ACTIVEMQ_DATA_DIR="$ACTIVEMQ_INSTANCE/data" -ACTIVEMQ_LOG_MANAGER=org.jboss.logmanager.LogManager -JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M" - -# Load Profile Data -. "$ACTIVEMQ_INSTANCE/etc/activemq.profile" - -CLASSPATH="$ACTIVEMQ_HOME/lib/artemis-boot.jar" - -# OS specific support. -cygwin=false; -darwin=false; -case "`uname`" in - CYGWIN*) cygwin=true - OSTYPE=cygwin - export OSTYPE - ;; - Darwin*) darwin=true - if [ -z "$JAVA_HOME" ] ; then - JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home - fi - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$ACTIVEMQ_INSTANCE" ] && - ACTIVEMQ_INSTANCE=`cygpath --unix "$ACTIVEMQ_INSTANCE"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD=`which java 2> /dev/null ` - if [ -z "$JAVACMD" ] ; then - JAVACMD=java - fi - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." - echo " We cannot execute $JAVACMD" - exit 1 -fi - -if $cygwin ; then - JAVA_HOME=`cygpath --windows "$JAVA_HOME"` - ACTIVEMQ_HOME=`cygpath --windows "$ACTIVEMQ_HOME"` - CLASSPATH=`cygpath --windows "$CLASSPATH"` -fi - -exec "$JAVACMD" $JAVA_ARGS $ACTIVEMQ_CLUSTER_PROPS \ - -classpath "$CLASSPATH" \ - -Dactivemq.home="$ACTIVEMQ_HOME" \ - -Dactivemq.instance="$ACTIVEMQ_INSTANCE" \ - -Djava.library.path="$ACTIVEMQ_HOME/bin/lib/linux-i686:$ACTIVEMQ_INSTANCE/bin/lib/linux-x86_64" \ - -Djava.io.tmpdir="$ACTIVEMQ_INSTANCE/tmp" \ - -Ddata.dir="$ACTIVEMQ_DATA_DIR" \ - -Djava.util.logging.manager="$ACTIVEMQ_LOG_MANAGER" \ - -Dlogging.configuration="$ACTIVEMQ_LOGGING_CONF" \ - $DEBUG_ARGS \ - org.apache.activemq.artemis.boot.ActiveMQ $@ http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq-service ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq-service b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq-service deleted file mode 100755 index 84235c9..0000000 --- a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq-service +++ /dev/null @@ -1,154 +0,0 @@ -#!/bin/sh -# 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. - -service=`basename "$0"` - -# -# Discover the ACTIVEMQ_INSTANCE from the location of this script. -# -if [ -z "$ACTIVEMQ_INSTANCE" ] ; then - - ## resolve links - $0 may be a link to ActiveMQ's home - PRG="$0" - saveddir=`pwd` - - # need this for relative symlinks - dirname_prg=`dirname "$PRG"` - cd "$dirname_prg" - - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '.*/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi - done - - ACTIVEMQ_INSTANCE=`dirname "$PRG"` - cd "$saveddir" - - # make it fully qualified - ACTIVEMQ_INSTANCE=`cd "$ACTIVEMQ_INSTANCE/.." && pwd` - export ACTIVEMQ_INSTANCE - -fi - -PID_FILE="${ACTIVEMQ_INSTANCE}/data/activemq.pid" - -if [ ! -d "${ACTIVEMQ_INSTANCE}/data/" ]; then - mkdir "${ACTIVEMQ_INSTANCE}/data/" -fi - -status() { - if [ -f "${PID_FILE}" ] ; then - pid=`cat "${PID_FILE}"` - # check to see if it's gone... - ps -p ${pid} > /dev/null - if [ $? -eq 0 ] ; then - return 0 - else - rm "${PID_FILE}" - return 3 - fi - fi - return 3 -} - -stop() { - if [ -f "${PID_FILE}" ] ; then - pid=`cat "${PID_FILE}"` - kill $@ ${pid} > /dev/null - fi - for i in 1 2 3 4 5 ; do - status - if [ $? -ne 0 ] ; then - return 0 - fi - sleep 1 - done - echo "Could not stop process ${pid}" - return 1 -} - -start() { - - status - if [ $? -eq 0 ] ; then - echo "Already running." - return 1 - fi - - nohup ${ACTIVEMQ_INSTANCE}/bin/activemq run > /dev/null 2> /dev/null & - - echo $! > "${PID_FILE}" - - # check to see if stays up... - sleep 1 - status - if [ $? -ne 0 ] ; then - echo "Could not start ${service}" - return 1 - fi - echo "${service} is now running (${pid})" - return 0 -} - -case $1 in - start) - echo "Starting ${service}" - start - exit $? - ;; - - force-stop) - echo "Forcibly Stopping ${service}" - stop -9 - exit $? - ;; - - stop) - echo "Gracefully Stopping ${service}" - stop - exit $? - ;; - - restart) - echo "Restarting ${service}" - stop - start - exit $? - ;; - - status) - status - rc=$? - if [ $rc -eq 0 ] ; then - echo "${service} is running (${pid})" - else - echo "${service} is stopped" - fi - exit $rc - ;; - - *) - echo "Usage: $0 {start|stop|restart|force-stop|status}" >&2 - exit 2 - ;; -esac http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq-service.xml ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq-service.xml b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq-service.xml deleted file mode 100644 index 12dc6ce..0000000 --- a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq-service.xml +++ /dev/null @@ -1,59 +0,0 @@ -<!-- - - 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. - ---> - -<service> - <id>activemq-${host}</id> - <name>ActiveMQ: ${host}</name> - <description>Apache ActiveMQ Artemis is a reliable messaging broker</description> - - <logpath>${activemq.instance}\log</logpath> - <logmode>roll</logmode> - - <executable>"${java.home}\bin\java.exe"</executable> - <argument>-XX:+UseParallelGC</argument> - <argument>-XX:+AggressiveOpts</argument> - <argument>-XX:+UseFastAccessorMethods</argument> - <argument>-Xms512M</argument> - <argument>-Xmx1024M</argument> - - <!-- Cluster Properties: Used to pass arguments to ActiveMQ which can be referenced in broker.xml - <argument>-Dactivemq.remoting.default.port=61617</argument> - <argument>-Dactivemq.remoting.amqp.port=5673</argument> - <argument>-Dactivemq.remoting.stomp.port=61614</argument> - <argument>-Dactivemq.remoting.hornetq.port=5446</argument> - --> - - <argument>-classpath</argument> - <argument>"${activemq.home}\lib\artemis-boot.jar"</argument> - <argument>"-Dactivemq.home=${activemq.home}"</argument> - <argument>"-Dactivemq.instance=${activemq.instance}"</argument> - <argument>"-Ddata.dir=${activemq.instance}/data"</argument> - <argument>-Djava.util.logging.manager=org.jboss.logmanager.LogManager</argument> - <argument>"-Dlogging.configuration=file:${activemq.instance}\etc\logging.properties"</argument> - - - <!-- Debug args: Uncomment to enable debug - <argument>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005</argument> - --> - - <argument>ActiveMQ</argument> - - <argument>run</argument> - -</service> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq.cmd ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq.cmd b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq.cmd deleted file mode 100755 index fd56f09..0000000 --- a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/activemq.cmd +++ /dev/null @@ -1,76 +0,0 @@ -@echo off -rem Licensed to the Apache Software Foundation (ASF) under one -rem or more contributor license agreements. See the NOTICE file -rem distributed with this work for additional information -rem regarding copyright ownership. The ASF licenses this file -rem to you under the Apache License, Version 2.0 (the -rem "License"); you may not use this file except in compliance -rem with the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, -rem software distributed under the License is distributed on an -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -rem KIND, either express or implied. See the License for the -rem specific language governing permissions and limitations -rem under the License. - -setlocal - -if NOT "%ACTIVEMQ_INSTANCE%"=="" goto CHECK_ACTIVEMQ_INSTANCE -PUSHD . -CD %~dp0.. -set ACTIVEMQ_INSTANCE=%CD% -POPD - -:CHECK_ACTIVEMQ_INSTANCE -if exist "%ACTIVEMQ_INSTANCE%\bin\activemq.cmd" goto CHECK_JAVA - -:NO_HOME -echo ACTIVEMQ_INSTANCE environment variable is set incorrectly. Please set ACTIVEMQ_INSTANCE. -goto END - -:CHECK_JAVA -set _JAVACMD=%JAVACMD% - -if "%JAVA_HOME%" == "" goto NO_JAVA_HOME -if not exist "%JAVA_HOME%\bin\java.exe" goto NO_JAVA_HOME -if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe -goto RUN_JAVA - -:NO_JAVA_HOME -if "%_JAVACMD%" == "" set _JAVACMD=java.exe -echo. -echo Warning: JAVA_HOME environment variable is not set. -echo. - -:RUN_JAVA - -rem "Set Defaults." -set JAVA_ARGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M -set ACTIVEMQ_LOGGING_CONF=file:%ACTIVEMQ_INSTANCE%\etc\logging.properties -set ACTIVEMQ_DATA_DIR=%ACTIVEMQ_INSTANCE%\data -set ACTIVEMQ_LOG_MANAGER=org.jboss.logmanager.LogManager - -rem "Load Profile Config" -call "%ACTIVEMQ_INSTANCE%\etc\activemq.profile.cmd" %* - -rem "Create full JVM Args" -set JVM_ARGS=%JAVA_ARGS% -if not "%ACTIVEMQ_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ACTIVEMQ_CLUSTER_PROPS% -set JVM_ARGS=%JVM_ARGS% -classpath "%ACTIVEMQ_HOME%\lib\artemis-boot.jar" -set JVM_ARGS=%JVM_ARGS% -Dactivemq.home="%ACTIVEMQ_HOME%" -set JVM_ARGS=%JVM_ARGS% -Dactivemq.instance="%ACTIVEMQ_INSTANCE%" -set JVM_ARGS=%JVM_ARGS% -Ddata.dir="%ACTIVEMQ_DATA_DIR%" -set JVM_ARGS=%JVM_ARGS% -Djava.util.logging.manager="%ACTIVEMQ_LOG_MANAGER%" -set JVM_ARGS=%JVM_ARGS% -Dlogging.configuration="%ACTIVEMQ_LOGGING_CONF%" -if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS% - -"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.artemis.boot.ActiveMQ %* - -:END -endlocal -GOTO :EOF - -:EOF http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis new file mode 100755 index 0000000..7b6dfcd --- /dev/null +++ b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis @@ -0,0 +1,119 @@ +#!/bin/sh +# 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. + +if [ -z "$ARTEMIS_INSTANCE" ] ; then + + ## resolve links - $0 may be a link to ActiveMQ's home + PRG="$0" + progname=`basename "$0"` + saveddir=`pwd` + + # need this for relative symlinks + dirname_prg=`dirname "$PRG"` + cd "$dirname_prg" + + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '.*/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi + done + + ARTEMIS_INSTANCE=`dirname "$PRG"` + cd "$saveddir" + + # make it fully qualified + ARTEMIS_INSTANCE=`cd "$ARTEMIS_INSTANCE/.." && pwd` +fi + +# Set Defaults Properties +ARTEMIS_LOGGING_CONF="file:$ARTEMIS_INSTANCE/etc/logging.properties" +ARTEMIS_DATA_DIR="$ARTEMIS_INSTANCE/data" +ARTEMIS_LOG_MANAGER=org.jboss.logmanager.LogManager +JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M" + +# Load Profile Data +. "$ARTEMIS_INSTANCE/etc/artemis.profile" + +CLASSPATH="$ARTEMIS_HOME/lib/artemis-boot.jar" + +# OS specific support. +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) cygwin=true + OSTYPE=cygwin + export OSTYPE + ;; + Darwin*) darwin=true + if [ -z "$JAVA_HOME" ] ; then + JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home + fi + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$ARTEMIS_INSTANCE" ] && + ARTEMIS_INSTANCE=`cygpath --unix "$ARTEMIS_INSTANCE"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD=`which java 2> /dev/null ` + if [ -z "$JAVACMD" ] ; then + JAVACMD=java + fi + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." + echo " We cannot execute $JAVACMD" + exit 1 +fi + +if $cygwin ; then + JAVA_HOME=`cygpath --windows "$JAVA_HOME"` + ARTEMIS_HOME=`cygpath --windows "$ARTEMIS_HOME"` + CLASSPATH=`cygpath --windows "$CLASSPATH"` +fi + +exec "$JAVACMD" $JAVA_ARGS $ARTEMIS_CLUSTER_PROPS \ + -classpath "$CLASSPATH" \ + -Dartemis.home="$ARTEMIS_HOME" \ + -Dartemis.instance="$ARTEMIS_INSTANCE" \ + -Djava.library.path="$ARTEMIS_HOME/bin/lib/linux-i686:$ARTEMIS_INSTANCE/bin/lib/linux-x86_64" \ + -Djava.io.tmpdir="$ARTEMIS_INSTANCE/tmp" \ + -Ddata.dir="$ARTEMIS_DATA_DIR" \ + -Djava.util.logging.manager="$ARTEMIS_LOG_MANAGER" \ + -Dlogging.configuration="$ARTEMIS_LOGGING_CONF" \ + $DEBUG_ARGS \ + org.apache.activemq.artemis.boot.Artemis $@ http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis-service ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis-service b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis-service new file mode 100755 index 0000000..7a53901 --- /dev/null +++ b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis-service @@ -0,0 +1,154 @@ +#!/bin/sh +# 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. + +service=`basename "$0"` + +# +# Discover the ARTEMIS_INSTANCE from the location of this script. +# +if [ -z "$ARTEMIS_INSTANCE" ] ; then + + ## resolve links - $0 may be a link to ActiveMQ's home + PRG="$0" + saveddir=`pwd` + + # need this for relative symlinks + dirname_prg=`dirname "$PRG"` + cd "$dirname_prg" + + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '.*/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi + done + + ARTEMIS_INSTANCE=`dirname "$PRG"` + cd "$saveddir" + + # make it fully qualified + ARTEMIS_INSTANCE=`cd "$ARTEMIS_INSTANCE/.." && pwd` + export ARTEMIS_INSTANCE + +fi + +PID_FILE="${ARTEMIS_INSTANCE}/data/artemis.pid" + +if [ ! -d "${ARTEMIS_INSTANCE}/data/" ]; then + mkdir "${ARTEMIS_INSTANCE}/data/" +fi + +status() { + if [ -f "${PID_FILE}" ] ; then + pid=`cat "${PID_FILE}"` + # check to see if it's gone... + ps -p ${pid} > /dev/null + if [ $? -eq 0 ] ; then + return 0 + else + rm "${PID_FILE}" + return 3 + fi + fi + return 3 +} + +stop() { + if [ -f "${PID_FILE}" ] ; then + pid=`cat "${PID_FILE}"` + kill $@ ${pid} > /dev/null + fi + for i in 1 2 3 4 5 ; do + status + if [ $? -ne 0 ] ; then + return 0 + fi + sleep 1 + done + echo "Could not stop process ${pid}" + return 1 +} + +start() { + + status + if [ $? -eq 0 ] ; then + echo "Already running." + return 1 + fi + + nohup ${ARTEMIS_INSTANCE}/bin/artemis run > /dev/null 2> /dev/null & + + echo $! > "${PID_FILE}" + + # check to see if stays up... + sleep 1 + status + if [ $? -ne 0 ] ; then + echo "Could not start ${service}" + return 1 + fi + echo "${service} is now running (${pid})" + return 0 +} + +case $1 in + start) + echo "Starting ${service}" + start + exit $? + ;; + + force-stop) + echo "Forcibly Stopping ${service}" + stop -9 + exit $? + ;; + + stop) + echo "Gracefully Stopping ${service}" + stop + exit $? + ;; + + restart) + echo "Restarting ${service}" + stop + start + exit $? + ;; + + status) + status + rc=$? + if [ $rc -eq 0 ] ; then + echo "${service} is running (${pid})" + else + echo "${service} is stopped" + fi + exit $rc + ;; + + *) + echo "Usage: $0 {start|stop|restart|force-stop|status}" >&2 + exit 2 + ;; +esac http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis-service.xml ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis-service.xml b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis-service.xml new file mode 100644 index 0000000..a39d16f --- /dev/null +++ b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis-service.xml @@ -0,0 +1,59 @@ +<!-- + + 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. + +--> + +<service> + <id>armetis-${host}</id> + <name>ActiveMQ Artemis: ${host}</name> + <description>Apache ActiveMQ Artemis is a reliable messaging broker</description> + + <logpath>${artemis.instance}\log</logpath> + <logmode>roll</logmode> + + <executable>"${java.home}\bin\java.exe"</executable> + <argument>-XX:+UseParallelGC</argument> + <argument>-XX:+AggressiveOpts</argument> + <argument>-XX:+UseFastAccessorMethods</argument> + <argument>-Xms512M</argument> + <argument>-Xmx1024M</argument> + + <!-- Cluster Properties: Used to pass arguments to ActiveMQ which can be referenced in broker.xml + <argument>-Dartemis.remoting.default.port=61617</argument> + <argument>-Dartemis.remoting.amqp.port=5673</argument> + <argument>-Dartemis.remoting.stomp.port=61614</argument> + <argument>-Dartemis.remoting.hornetq.port=5446</argument> + --> + + <argument>-classpath</argument> + <argument>"${artemis.home}\lib\artemis-boot.jar"</argument> + <argument>"-artemis.home=${artemis.home}"</argument> + <argument>"-artemis.instance=${artemis.instance}"</argument> + <argument>"-Ddata.dir=${artemis.instance}/data"</argument> + <argument>-Djava.util.logging.manager=org.jboss.logmanager.LogManager</argument> + <argument>"-Dlogging.configuration=file:${artemis.instance}\etc\logging.properties"</argument> + + + <!-- Debug args: Uncomment to enable debug + <argument>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005</argument> + --> + + <argument>Armetis</argument> + + <argument>run</argument> + +</service> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis.cmd ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis.cmd b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis.cmd new file mode 100755 index 0000000..5e8f500 --- /dev/null +++ b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis.cmd @@ -0,0 +1,76 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one +rem or more contributor license agreements. See the NOTICE file +rem distributed with this work for additional information +rem regarding copyright ownership. The ASF licenses this file +rem to you under the Apache License, Version 2.0 (the +rem "License"); you may not use this file except in compliance +rem with the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, +rem software distributed under the License is distributed on an +rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +rem KIND, either express or implied. See the License for the +rem specific language governing permissions and limitations +rem under the License. + +setlocal + +if NOT "%ARTEMIS_INSTANCE%"=="" goto CHECK_ARTEMIS_INSTANCE +PUSHD . +CD %~dp0.. +set ARTEMIS_INSTANCE=%CD% +POPD + +:CHECK_ARTEMIS_INSTANCE +if exist "%ARTEMIS_INSTANCE%\bin\activemq.cmd" goto CHECK_JAVA + +:NO_HOME +echo ARTEMIS_INSTANCE environment variable is set incorrectly. Please set ARTEMIS_INSTANCE. +goto END + +:CHECK_JAVA +set _JAVACMD=%JAVACMD% + +if "%JAVA_HOME%" == "" goto NO_JAVA_HOME +if not exist "%JAVA_HOME%\bin\java.exe" goto NO_JAVA_HOME +if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe +goto RUN_JAVA + +:NO_JAVA_HOME +if "%_JAVACMD%" == "" set _JAVACMD=java.exe +echo. +echo Warning: JAVA_HOME environment variable is not set. +echo. + +:RUN_JAVA + +rem "Set Defaults." +set JAVA_ARGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M +set ARTEMIS_LOGGING_CONF=file:%ARTEMIS_INSTANCE%\etc\logging.properties +set ARTEMIS_DATA_DIR=%ARTEMIS_INSTANCE%\data +set ARTEMIS_LOG_MANAGER=org.jboss.logmanager.LogManager + +rem "Load Profile Config" +call "%ARTEMIS_INSTANCE%\etc\artemis.profile.cmd" %* + +rem "Create full JVM Args" +set JVM_ARGS=%JAVA_ARGS% +if not "%ARTEMIS_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ARTEMIS_CLUSTER_PROPS% +set JVM_ARGS=%JVM_ARGS% -classpath "%ARTEMIS_HOME%\lib\artemis-boot.jar" +set JVM_ARGS=%JVM_ARGS% -Dartemis.home="%ARTEMIS_HOME%" +set JVM_ARGS=%JVM_ARGS% -Dartemis.instance="%ARTEMIS_INSTANCE%" +set JVM_ARGS=%JVM_ARGS% -Ddata.dir="%ARTEMIS_DATA_DIR%" +set JVM_ARGS=%JVM_ARGS% -Djava.util.logging.manager="%ARTEMIS_LOG_MANAGER%" +set JVM_ARGS=%JVM_ARGS% -Dlogging.configuration="%ARTEMIS_LOGGING_CONF%" +if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS% + +"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.artemis.boot.Artemis %* + +:END +endlocal +GOTO :EOF + +:EOF http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/activemq.profile ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/activemq.profile b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/activemq.profile deleted file mode 100644 index 755fec1..0000000 --- a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/activemq.profile +++ /dev/null @@ -1,27 +0,0 @@ -# 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. - -ACTIVEMQ_HOME='${activemq.home}' - -# Cluster Properties: Used to pass arguments to ActiveMQ which can be referenced in broker.xml -#ACTIVEMQ_CLUSTER_PROPS="-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446" - -# Java Opts -#JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M" - -# Debug args: Uncomment to enable debug -#DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/activemq.profile.cmd ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/activemq.profile.cmd b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/activemq.profile.cmd deleted file mode 100644 index 3c28564..0000000 --- a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/activemq.profile.cmd +++ /dev/null @@ -1,27 +0,0 @@ -rem Licensed to the Apache Software Foundation (ASF) under one -rem or more contributor license agreements. See the NOTICE file -rem distributed with this work for additional information -rem regarding copyright ownership. The ASF licenses this file -rem to you under the Apache License, Version 2.0 (the -rem "License"); you may not use this file except in compliance -rem with the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, -rem software distributed under the License is distributed on an -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -rem KIND, either express or implied. See the License for the -rem specific language governing permissions and limitations -rem under the License. - -set ACTIVEMQ_HOME=${activemq.home} - -rem Cluster Properties: Used to pass arguments to ActiveMQ which can be referenced in broker.xml -rem set ACTIVEMQ_CLUSTER_PROPS=-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446 - -rem Java Opts -rem set JAVA_ARGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M - -rem Debug args: Uncomment to enable debug -rem set DEBUG_ARGS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile new file mode 100644 index 0000000..889a0a9 --- /dev/null +++ b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile @@ -0,0 +1,27 @@ +# 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. + +ARTEMIS_HOME='${artemis.home}' + +# Cluster Properties: Used to pass arguments to ActiveMQ which can be referenced in broker.xml +#ARTEMIS_CLUSTER_PROPS="-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446" + +# Java Opts +#JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M" + +# Debug args: Uncomment to enable debug +#DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd new file mode 100644 index 0000000..450ba79 --- /dev/null +++ b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd @@ -0,0 +1,27 @@ +rem Licensed to the Apache Software Foundation (ASF) under one +rem or more contributor license agreements. See the NOTICE file +rem distributed with this work for additional information +rem regarding copyright ownership. The ASF licenses this file +rem to you under the Apache License, Version 2.0 (the +rem "License"); you may not use this file except in compliance +rem with the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, +rem software distributed under the License is distributed on an +rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +rem KIND, either express or implied. See the License for the +rem specific language governing permissions and limitations +rem under the License. + +set ARTEMIS_HOME=${artemis.home} + +rem Cluster Properties: Used to pass arguments to ActiveMQ which can be referenced in broker.xml +rem set ARTEMIS_CLUSTER_PROPS=-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446 + +rem Java Opts +rem set JAVA_ARGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M + +rem Debug args: Uncomment to enable debug +rem set DEBUG_ARGS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap.xml ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap.xml b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap.xml index 530db62..1492425 100644 --- a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap.xml +++ b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap.xml @@ -19,12 +19,12 @@ <broker xmlns="http://activemq.org/schema"> <basic-security - users="file:${activemq.instance}/etc/activemq-users.properties" - roles="file:${activemq.instance}/etc/activemq-roles.properties" + users="file:${artemis.instance}/etc/activemq-users.properties" + roles="file:${artemis.instance}/etc/activemq-roles.properties" default-user="guest" /> - <server configuration="file:${activemq.instance}/etc/broker.xml"/> + <server configuration="file:${artemis.instance}/etc/broker.xml"/> <web bind="http://localhost:8161" path="web"> <app url="jolokia" war="jolokia-war-1.2.3.war"/> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/logging.properties ---------------------------------------------------------------------- diff --git a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/logging.properties b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/logging.properties index f4f4a81..084b74c 100644 --- a/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/logging.properties +++ b/artemis-bootstrap/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/logging.properties @@ -42,7 +42,7 @@ handler.FILE=org.jboss.logmanager.handlers.FileHandler handler.FILE.level=DEBUG handler.FILE.properties=autoFlush,fileName handler.FILE.autoFlush=true -handler.FILE.fileName=${activemq.instance}/log/activemq.log +handler.FILE.fileName=${artemis.instance}/log/activemq.log handler.FILE.formatter=PATTERN # Formatter pattern configuration http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ActiveMQXAResourceWrapperImplTest.java ---------------------------------------------------------------------- diff --git a/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ActiveMQXAResourceWrapperImplTest.java b/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ActiveMQXAResourceWrapperImplTest.java index 32cd969..7b2f7e8 100644 --- a/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ActiveMQXAResourceWrapperImplTest.java +++ b/artemis-service-extensions/src/test/java/org/apache/activemq/artemis/service/extensions/tests/xa/ActiveMQXAResourceWrapperImplTest.java @@ -40,7 +40,7 @@ public class ActiveMQXAResourceWrapperImplTest xaResourceWrapperProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_JNDI_NAME, jndiName); xaResourceWrapperProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_NODE_ID, nodeId); xaResourceWrapperProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_VERSION, "6"); - xaResourceWrapperProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_NAME, "ActiveMQ"); + xaResourceWrapperProperties.put(ActiveMQXAResourceWrapper.ACTIVEMQ_PRODUCT_NAME, "ActiveMQ Artemis"); ActiveMQXAResourceWrapperImpl xaResourceWrapper = new ActiveMQXAResourceWrapperImpl(xaResource, xaResourceWrapperProperties); String expectedJndiNodeId = jndiName + " NodeId:" + nodeId; http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/artemis-website/src/main/resources/examples/index.html ---------------------------------------------------------------------- diff --git a/artemis-website/src/main/resources/examples/index.html b/artemis-website/src/main/resources/examples/index.html index 2c2a746..f9875a3 100644 --- a/artemis-website/src/main/resources/examples/index.html +++ b/artemis-website/src/main/resources/examples/index.html @@ -60,7 +60,7 @@ to run a different example simply edit the <code>config/examples/bootstrap.xml</code> aand change the paths to point the correct configuration (this will be found in the directory of the example you wish to run). By default the broker will use the <code>data/server0</code> directory for the journal, to avoid problems it is best to delete this - directory between running different examples or set the <code>ACTIVEMQ_DATA_DIR</code> environment property in + directory between running different examples or set the <code>ARTEMIS_DATA_DIR</code> environment property in <code>activemq.conf</code>to use a different location</p> <div></div> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/distribution/artemis/src/main/resources/bin/activemq ---------------------------------------------------------------------- diff --git a/distribution/artemis/src/main/resources/bin/activemq b/distribution/artemis/src/main/resources/bin/activemq deleted file mode 100755 index ab76bac..0000000 --- a/distribution/artemis/src/main/resources/bin/activemq +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh -# 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. - -if [ -z "$ACTIVEMQ_HOME" ] ; then - - ## resolve links - $0 may be a link to ActiveMQ's home - PRG="$0" - progname=`basename "$0"` - saveddir=`pwd` - - # need this for relative symlinks - dirname_prg=`dirname "$PRG"` - cd "$dirname_prg" - - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '.*/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi - done - - ACTIVEMQ_HOME=`dirname "$PRG"` - cd "$saveddir" - - # make it fully qualified - ACTIVEMQ_HOME=`cd "$ACTIVEMQ_HOME/.." && pwd` -fi - -# Set Defaults Properties -JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M" -CLASSPATH="$ACTIVEMQ_HOME/lib/artemis-boot.jar" - -# OS specific support. -cygwin=false; -darwin=false; -case "`uname`" in - CYGWIN*) cygwin=true - OSTYPE=cygwin - export OSTYPE - ;; - Darwin*) darwin=true - if [ -z "$JAVA_HOME" ] ; then - JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home - fi - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$ACTIVEMQ_HOME" ] && - ACTIVEMQ_HOME=`cygpath --unix "$ACTIVEMQ_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD=`which java 2> /dev/null ` - if [ -z "$JAVACMD" ] ; then - JAVACMD=java - fi - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." - echo " We cannot execute $JAVACMD" - exit 1 -fi - - -if $cygwin ; then - JAVA_HOME=`cygpath --windows "$JAVA_HOME"` - ACTIVEMQ_HOME=`cygpath --windows "$ACTIVEMQ_HOME"` - CLASSPATH=`cygpath --windows "$CLASSPATH"` -fi - -exec "$JAVACMD" $JAVA_ARGS $ACTIVEMQ_CLUSTER_PROPS \ - -classpath "$CLASSPATH" \ - -Dactivemq.home="$ACTIVEMQ_HOME" \ - -Djava.library.path="$ACTIVEMQ_HOME/bin/lib/linux-i686:$ACTIVEMQ_INSTANCE/bin/lib/linux-x86_64" \ - $DEBUG_ARGS \ - org.apache.activemq.artemis.boot.ActiveMQ $@ http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/distribution/artemis/src/main/resources/bin/activemq.cmd ---------------------------------------------------------------------- diff --git a/distribution/artemis/src/main/resources/bin/activemq.cmd b/distribution/artemis/src/main/resources/bin/activemq.cmd deleted file mode 100755 index 344c9df..0000000 --- a/distribution/artemis/src/main/resources/bin/activemq.cmd +++ /dev/null @@ -1,66 +0,0 @@ -@echo off -rem Licensed to the Apache Software Foundation (ASF) under one -rem or more contributor license agreements. See the NOTICE file -rem distributed with this work for additional information -rem regarding copyright ownership. The ASF licenses this file -rem to you under the Apache License, Version 2.0 (the -rem "License"); you may not use this file except in compliance -rem with the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, -rem software distributed under the License is distributed on an -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -rem KIND, either express or implied. See the License for the -rem specific language governing permissions and limitations -rem under the License. - -setlocal - -if NOT "%ACTIVEMQ_HOME%"=="" goto CHECK_ACTIVEMQ_HOME -PUSHD . -CD %~dp0.. -set ACTIVEMQ_HOME=%CD% -POPD - -:CHECK_ACTIVEMQ_HOME -if exist "%ACTIVEMQ_HOME%\bin\activemq.cmd" goto CHECK_JAVA - -:NO_HOME -echo ACTIVEMQ_HOME environment variable is set incorrectly. Please set ACTIVEMQ_HOME. -goto END - -:CHECK_JAVA -set _JAVACMD=%JAVACMD% - -if "%JAVA_HOME%" == "" goto NO_JAVA_HOME -if not exist "%JAVA_HOME%\bin\java.exe" goto NO_JAVA_HOME -if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe -goto RUN_JAVA - -:NO_JAVA_HOME -if "%_JAVACMD%" == "" set _JAVACMD=java.exe -echo. -echo Warning: JAVA_HOME environment variable is not set. -echo. - -:RUN_JAVA - -rem "Set Defaults." -set JAVA_ARGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M - -rem "Create full JVM Args" -set JVM_ARGS=%JAVA_ARGS% -if not "%ACTIVEMQ_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ACTIVEMQ_CLUSTER_PROPS% -set JVM_ARGS=%JVM_ARGS% -classpath "%ACTIVEMQ_HOME%\lib\artemis-boot.jar" -set JVM_ARGS=%JVM_ARGS% -Dactivemq.home="%ACTIVEMQ_HOME%" -if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS% - -"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.artemis.boot.ActiveMQ %* - -:END -endlocal -GOTO :EOF - -:EOF http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/distribution/artemis/src/main/resources/bin/artemis ---------------------------------------------------------------------- diff --git a/distribution/artemis/src/main/resources/bin/artemis b/distribution/artemis/src/main/resources/bin/artemis new file mode 100755 index 0000000..f31e351 --- /dev/null +++ b/distribution/artemis/src/main/resources/bin/artemis @@ -0,0 +1,108 @@ +#!/bin/sh +# 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. + +if [ -z "$ARTEMIS_HOME" ] ; then + + ## resolve links - $0 may be a link to ActiveMQ's home + PRG="$0" + progname=`basename "$0"` + saveddir=`pwd` + + # need this for relative symlinks + dirname_prg=`dirname "$PRG"` + cd "$dirname_prg" + + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '.*/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi + done + + ARTEMIS_HOME=`dirname "$PRG"` + cd "$saveddir" + + # make it fully qualified + ARTEMIS_HOME=`cd "$ARTEMIS_HOME/.." && pwd` +fi + +# Set Defaults Properties +JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M" +CLASSPATH="$ARTEMIS_HOME/lib/artemis-boot.jar" + +# OS specific support. +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) cygwin=true + OSTYPE=cygwin + export OSTYPE + ;; + Darwin*) darwin=true + if [ -z "$JAVA_HOME" ] ; then + JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home + fi + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$ARTEMIS_HOME" ] && + ARTEMIS_HOME=`cygpath --unix "$ARTEMIS_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD=`which java 2> /dev/null ` + if [ -z "$JAVACMD" ] ; then + JAVACMD=java + fi + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." + echo " We cannot execute $JAVACMD" + exit 1 +fi + + +if $cygwin ; then + JAVA_HOME=`cygpath --windows "$JAVA_HOME"` + ARTEMIS_HOME=`cygpath --windows "$ARTEMIS_HOME"` + CLASSPATH=`cygpath --windows "$CLASSPATH"` +fi + +exec "$JAVACMD" $JAVA_ARGS $ARTEMIS_CLUSTER_PROPS \ + -classpath "$CLASSPATH" \ + -Dartemis.home="$ARTEMIS_HOME" \ + -Djava.library.path="$ARTEMIS_HOME/bin/lib/linux-i686:$ARTEMIS_INSTANCE/bin/lib/linux-x86_64" \ + $DEBUG_ARGS \ + org.apache.activemq.artemis.boot.Artemis $@ http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/distribution/artemis/src/main/resources/bin/artemis.cmd ---------------------------------------------------------------------- diff --git a/distribution/artemis/src/main/resources/bin/artemis.cmd b/distribution/artemis/src/main/resources/bin/artemis.cmd new file mode 100755 index 0000000..4132fb6 --- /dev/null +++ b/distribution/artemis/src/main/resources/bin/artemis.cmd @@ -0,0 +1,66 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one +rem or more contributor license agreements. See the NOTICE file +rem distributed with this work for additional information +rem regarding copyright ownership. The ASF licenses this file +rem to you under the Apache License, Version 2.0 (the +rem "License"); you may not use this file except in compliance +rem with the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, +rem software distributed under the License is distributed on an +rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +rem KIND, either express or implied. See the License for the +rem specific language governing permissions and limitations +rem under the License. + +setlocal + +if NOT "%ARTEMIS_HOME%"=="" goto CHECK_ARTEMIS_HOME +PUSHD . +CD %~dp0.. +set ARTEMIS_HOME=%CD% +POPD + +:CHECK_ARTEMIS_HOME +if exist "%ARTEMIS_HOME%\bin\artemis.cmd" goto CHECK_JAVA + +:NO_HOME +echo ARTEMIS_HOME environment variable is set incorrectly. Please set ARTEMIS_HOME. +goto END + +:CHECK_JAVA +set _JAVACMD=%JAVACMD% + +if "%JAVA_HOME%" == "" goto NO_JAVA_HOME +if not exist "%JAVA_HOME%\bin\java.exe" goto NO_JAVA_HOME +if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe +goto RUN_JAVA + +:NO_JAVA_HOME +if "%_JAVACMD%" == "" set _JAVACMD=java.exe +echo. +echo Warning: JAVA_HOME environment variable is not set. +echo. + +:RUN_JAVA + +rem "Set Defaults." +set JAVA_ARGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M + +rem "Create full JVM Args" +set JVM_ARGS=%JAVA_ARGS% +if not "%ARTEMIS_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ARTEMIS_CLUSTER_PROPS% +set JVM_ARGS=%JVM_ARGS% -classpath "%ARTEMIS_HOME%\lib\artemis-boot.jar" +set JVM_ARGS=%JVM_ARGS% -Dartemis.home="%ARTEMIS_HOME%" +if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS% + +"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.artemis.boot.Artemis %* + +:END +endlocal +GOTO :EOF + +:EOF http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/docs/quickstart-guide/en/running.md ---------------------------------------------------------------------- diff --git a/docs/quickstart-guide/en/running.md b/docs/quickstart-guide/en/running.md index 0a9a0d9..5bd483a 100644 --- a/docs/quickstart-guide/en/running.md +++ b/docs/quickstart-guide/en/running.md @@ -4,7 +4,7 @@ Creating a Broker Instance A broker instance is the directory containing all the configuration and runtime data, such as logs and data files, associated with a broker process. It is recommended that -you do *not* create the instance directory under `${ACTIVEMQ_HOME}`. This separation is +you do *not* create the instance directory under `${ARTEMIS_HOME}`. This separation is encouraged so that you can more easily upgrade when the next version of ActiveMQ is released. On Unix systems, it is a common convention to store this kind of runtime data under @@ -12,7 +12,7 @@ the `/var/lib` directory. For example, to create an instance at '/var/lib/mybro the following commands in your command line shell: cd /var/lib - ${ACTIVEMQ_HOME}/bin/activemq create mybroker + ${ARTEMIS_HOME}/bin/activemq create mybroker A broker instance directory will contain the following sub directories: http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34f8e538/docs/user-manual/en/using-server.md ---------------------------------------------------------------------- diff --git a/docs/user-manual/en/using-server.md b/docs/user-manual/en/using-server.md index 9f7a37b..cbae852 100644 --- a/docs/user-manual/en/using-server.md +++ b/docs/user-manual/en/using-server.md @@ -10,13 +10,13 @@ we mean the Apache ActiveMQ Artemis standalone server, in its default configurat with a JMS Service enabled. This document will refer to the full path of the directory where the ActiveMQ -distribution has been extracted to as `${ACTIVEMQ_HOME}` directory. +distribution has been extracted to as `${ARTEMIS_HOME}` directory. ## Creating a Broker Instance A broker instance is the directory containing all the configuration and runtime data, such as logs and data files, associated with a broker process. It is recommended that -you do *not* create the instance directory under `${ACTIVEMQ_HOME}`. This separation is +you do *not* create the instance directory under `${ARTEMIS_HOME}`. This separation is encouraged so that you can more easily upgrade when the next version of ActiveMQ is released. On Unix systems, it is a common convention to store this kind of runtime data under @@ -24,7 +24,7 @@ the `/var/lib` directory. For example, to create an instance at '/var/lib/mybro the following commands in your command line shell: cd /var/lib - ${ACTIVEMQ_HOME}/bin/activemq create mybroker + ${ARTEMIS_HOME}/bin/activemq create mybroker A broker instance directory will contain the following sub directories:
