Implementation for ACTIVEMQ6-98: Make the the distro readonly and support creating mutable broker instances dirs.
Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/3c9e16fc Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/3c9e16fc Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/3c9e16fc Branch: refs/heads/master Commit: 3c9e16fc20d4eb8e3e3944acfb9d9048a6942445 Parents: 45f02a8 Author: Hiram Chirino <[email protected]> Authored: Wed Apr 15 18:45:37 2015 -0400 Committer: Hiram Chirino <[email protected]> Committed: Wed Apr 15 18:45:37 2015 -0400 ---------------------------------------------------------------------- .gitignore | 1 + .../java/org/apache/activemq/cli/ActiveMQ.java | 27 +- .../apache/activemq/cli/commands/Create.java | 362 +++++++++++++++++++ .../org/apache/activemq/cli/commands/Run.java | 10 +- .../org/apache/activemq/cli/commands/Stop.java | 8 +- .../apache/activemq/cli/commands/bin/activemq | 125 +++++++ .../activemq/cli/commands/bin/activemq-service | 154 ++++++++ .../activemq/cli/commands/bin/activemq.cmd | 72 ++++ .../apache/activemq/cli/commands/bin/run.bat | 17 + .../org/apache/activemq/cli/commands/bin/run.sh | 19 + .../apache/activemq/cli/commands/bin/stop.bat | 17 + .../apache/activemq/cli/commands/bin/stop.sh | 19 + .../cli/commands/etc/activemq-configuration.xml | 81 +++++ .../cli/commands/etc/activemq-roles.properties | 17 + .../cli/commands/etc/activemq-users.properties | 17 + .../activemq/cli/commands/etc/activemq.profile | 27 ++ .../cli/commands/etc/activemq.profile.cmd | 37 ++ .../activemq/cli/commands/etc/bootstrap.xml | 34 ++ .../cli/commands/etc/cluster-settings.txt | 25 ++ .../cli/commands/etc/logging.properties | 51 +++ .../cli/commands/etc/replicated-settings.txt | 6 + .../cli/commands/etc/shared-store-settings.txt | 6 + .../apache/activemq/dto/BasicSecurityDTO.java | 12 +- .../java/org/apache/activemq/dto/XmlUtil.java | 1 + .../activemq/src/main/resources/bin/activemq | 14 +- .../src/main/resources/bin/activemq-service | 154 -------- .../src/main/resources/bin/activemq.conf | 34 -- .../src/main/resources/bin/activemq.conf.bat | 34 -- .../activemq/src/main/resources/bin/run.bat | 17 - .../activemq/src/main/resources/bin/run.sh | 19 - .../activemq/src/main/resources/bin/stop.bat | 17 - .../activemq/src/main/resources/bin/stop.sh | 19 - .../config/clustered/activemq-configuration.xml | 104 ------ .../config/clustered/activemq-roles.properties | 17 - .../config/clustered/activemq-users.properties | 17 - .../resources/config/clustered/bootstrap.xml | 34 -- .../resources/config/examples/bootstrap.xml | 33 -- .../main/resources/config/logging.properties | 51 --- .../non-clustered/activemq-configuration.xml | 77 ---- .../non-clustered/activemq-roles.properties | 17 - .../non-clustered/activemq-users.properties | 17 - .../config/non-clustered/bootstrap.xml | 34 -- .../replicated/activemq-configuration.xml | 115 ------ .../config/replicated/activemq-roles.properties | 17 - .../config/replicated/activemq-users.properties | 17 - .../resources/config/replicated/bootstrap.xml | 34 -- .../shared-store/activemq-configuration.xml | 115 ------ .../shared-store/activemq-roles.properties | 17 - .../shared-store/activemq-users.properties | 17 - .../resources/config/shared-store/bootstrap.xml | 34 -- docs/quickstart-guide/en/installation.md | 16 +- docs/quickstart-guide/en/running.md | 159 +++----- docs/user-manual/en/using-server.md | 62 ++-- 53 files changed, 1217 insertions(+), 1240 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 015033e..e8f4b13 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ dependency-reduced-pom.xml # compilation from native */*/bin *~ +.DS_Store target tests/integration-tests/data/ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/java/org/apache/activemq/cli/ActiveMQ.java ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/ActiveMQ.java b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/ActiveMQ.java index 11a4028..321ea98 100644 --- a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/ActiveMQ.java +++ b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/ActiveMQ.java @@ -20,6 +20,7 @@ import io.airlift.command.Cli; import io.airlift.command.ParseArgumentsUnexpectedException; import org.apache.activemq.cli.commands.Action; import org.apache.activemq.cli.commands.ActionContext; +import org.apache.activemq.cli.commands.Create; import org.apache.activemq.cli.commands.HelpAction; import org.apache.activemq.cli.commands.Run; import org.apache.activemq.cli.commands.Stop; @@ -32,15 +33,27 @@ 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") - .withDefaultCommand(HelpAction.class) - .withCommand(Run.class) - .withCommand(Stop.class) - .withCommand(HelpAction.class) - .withDescription("ActiveMQ Command Line"); + .withDescription("ActiveMQ Command Line") + .withCommand(HelpAction.class) + .withCommand(Create.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(); + Cli<Action> parser = builder.build(); try { parser.parse(args).execute(ActionContext.system()); @@ -55,7 +68,7 @@ public class ActiveMQ { System.err.println(configException.getMessage()); System.out.println(); - System.out.println("Configuration should be specified as 'scheme:location'. Default configuration is 'xml:${ACTIVEMQ_HOME}/config/non-clustered/bootstrap.xml'"); + System.out.println("Configuration should be specified as 'scheme:location'. Default configuration is 'xml:${ACTIVEMQ_INSTANCE}/etc/bootstrap.xml'"); } } http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Create.java ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Create.java b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Create.java new file mode 100644 index 0000000..cc9b19c --- /dev/null +++ b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Create.java @@ -0,0 +1,362 @@ +package org.apache.activemq.cli.commands; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.attribute.PosixFilePermission; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.airlift.command.Arguments; +import io.airlift.command.Command; +import io.airlift.command.Option; + +import static java.nio.file.attribute.PosixFilePermission.GROUP_EXECUTE; +import static java.nio.file.attribute.PosixFilePermission.GROUP_READ; +import static java.nio.file.attribute.PosixFilePermission.GROUP_WRITE; +import static java.nio.file.attribute.PosixFilePermission.OTHERS_EXECUTE; +import static java.nio.file.attribute.PosixFilePermission.OTHERS_READ; +import static java.nio.file.attribute.PosixFilePermission.OWNER_EXECUTE; +import static java.nio.file.attribute.PosixFilePermission.OWNER_READ; +import static java.nio.file.attribute.PosixFilePermission.OWNER_WRITE; + +/** + * CLI action that creates a broker instance directory. + */ +@Command(name = "create", description = "creates a new broker instance") +public class Create implements Action +{ + @Arguments(description = "The instance directory to hold the broker's configuration and data", required = true) + File directory; + + @Option(name = "--host", description = "The host name of the broker") + String host; + + @Option(name = "--force", description = "Overwrite configuration at destination directory") + boolean force; + + @Option(name = "--home", description = "Directory where ActiveMQ is installed") + File home; + + @Option(name = "--with-ssl", description = "Generate an SSL enabled configuration") + boolean with_ssl = true; + + @Option(name = "--clustered", description = "Enable clustering") + boolean clustered = false; + + @Option(name = "--replicated", description = "Enable broker replication") + boolean replicated = false; + + @Option(name = "--shared-store", description = "Enable broker shared store") + boolean sharedStore = false; + + @Option(name = "--encoding", description = "The encoding that text files should use") + String encoding = "UTF-8"; + + ActionContext context; + boolean IS_WINDOWS; + boolean IS_CYGWIN; + + @Override + public Object execute(ActionContext context) throws Exception + { + try + { + return run(context); + } + catch (Throwable e) + { + e.printStackTrace(context.err); + return e; + } + } + + public Object run(ActionContext context) throws Exception + { + this.context = context; + IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win"); + IS_CYGWIN = IS_WINDOWS && System.getenv("OSTYPE") == "cygwin"; + + if (clustered & sharedStore) + { + + } + + context.out.println(String.format("Creating ActiveMQ instance at: %s", directory.getCanonicalPath())); + if (host == null) + { + host = directory.getName(); + } + + new File(directory, "bin").mkdirs(); + new File(directory, "etc").mkdirs(); + new File(directory, "log").mkdirs(); + new File(directory, "tmp").mkdirs(); + new File(directory, "data").mkdirs(); + + write("bin/activemq", null, true); + makeExec("bin/activemq"); + + write("bin/activemq.cmd", null, false); + write("bin/activemq-service", null, true); + makeExec("bin/activemq-service"); + + write("bin/run.bat", null, false); + write("bin/run.sh", null, true); + makeExec("bin/run.sh"); + + write("bin/stop.bat", null, false); + write("bin/stop.sh", null, true); + makeExec("bin/stop.sh"); + + write("etc/logging.properties", null, false); + write("etc/bootstrap.xml", null, false); + + HashMap<String, String> filters = new HashMap<String, String>(); + + String replicatedSettings = ""; + if (replicated) + { + clustered = true; + replicatedSettings = readTextFile("etc/replicated-settings.txt"); + } + filters.put("${replicated.settings}", replicatedSettings); + + String sharedStoreSettings = ""; + if (sharedStore) + { + clustered = true; + sharedStoreSettings = readTextFile("etc/shared-store-settings.txt"); + } + filters.put("${hared-store.settings}", sharedStoreSettings); + + String clusterSettings = ""; + if (clustered) + { + clusterSettings = readTextFile("etc/cluster-settings.txt"); + } + filters.put("${cluster.settings}", clusterSettings); + + + filters.put("${user}", System.getProperty("user.name", "")); + filters.put("${host}", host); + if (home != null) + { + 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("${java.home}", path(System.getProperty("java.home"), false)); + + write("etc/activemq.profile", filters, true); + makeExec("etc/activemq.profile"); + + write("etc/activemq.profile.cmd", filters, false); + write("etc/activemq-configuration.xml", filters, false); + write("etc/activemq-roles.properties", null, false); + write("etc/activemq-users.properties", null, false); + + + 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))); + + File service = new File(directory, "bin/activemq-service"); + context.out.println(""); + + if (!IS_WINDOWS || IS_CYGWIN) + { + + // Does it look like we are on a System V init system? + if (new File("/etc/init.d/").isDirectory()) + { + 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(""); + + } + else + { + + context.out.println("Or you can run the broker in the background using:"); + context.out.println(""); + context.out.println(String.format(" \"%s\" start", path(service, true))); + context.out.println(""); + } + + } +// if ( IS_WINDOWS ) { +// +// context.out.println("Or you can setup the broker as Windows service and run it in the background:"); +// context.out.println(""); +// context.out.println(String.format(" \"%s\" install", path(service,true))); +// context.out.println(String.format(" \"%s\" start", path(service, true))); +// context.out.println(""); +// +// } + + return null; + } + + private void makeExec(String path) throws IOException + { + File file = new File(directory, path); + Files.setPosixFilePermissions(file.toPath(), new HashSet<PosixFilePermission>(Arrays.asList( + OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, + GROUP_READ, GROUP_WRITE, GROUP_EXECUTE, + OTHERS_READ, OTHERS_EXECUTE + ))); + } + + String path(String value, boolean unixPaths) throws IOException + { + return path(new File(value), unixPaths); + } + + private String path(File value, boolean unixPaths) throws IOException + { + if (unixPaths && IS_CYGWIN) + { +// import scala.sys.process._ +// Seq("cygpath", value.getCanonicalPath).!!.trim + return value.getCanonicalPath(); + } + else + { + return value.getCanonicalPath(); + } + } + + private void write(String source, HashMap<String, String> filters, boolean unixTarget) throws IOException + { + write(source, new File(directory, source), filters, unixTarget); + } + + private void write(String source, File target, HashMap<String, String> filters, boolean unixTarget) throws IOException + { + if (target.exists() && !force) + { + throw new RuntimeException(String.format("The file '%s' already exists. Use --force to overwrite.", target)); + } + + String content = readTextFile(source); + + if (filters != null) + { + for (Map.Entry<String, String> entry : filters.entrySet()) + { + content = replace(content, entry.getKey(), entry.getValue()); + } + } + + // and then writing out in the new target encoding.. Let's also replace \n with the values + // that is correct for the current platform. + String separator = unixTarget && IS_CYGWIN ? "\n" : System.getProperty("line.separator"); + content = content.replaceAll("\\r?\\n", Matcher.quoteReplacement(separator)); + ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes(encoding)); + + try (FileOutputStream fout = new FileOutputStream(target)) + { + copy(in, fout); + } + } + + private String readTextFile(String source) throws IOException + { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + try (InputStream in = this.getClass().getResourceAsStream(source)) + { + copy(in, out); + } + return new String(out.toByteArray(), "UTF-8"); + } + + private void write(String source, File target) throws IOException + { + if (target.exists() && !force) + { + throw new RuntimeException(String.format("The file '%s' already exists. Use --force to overwrite.", target)); + } + try (FileOutputStream fout = new FileOutputStream(target)) + { + try (InputStream in = this.getClass().getResourceAsStream(source)) + { + copy(in, fout); + } + } + } + + private boolean canLoad(String name) + { + try + { + this.getClass().getClassLoader().loadClass(name); + return true; + } + catch (Throwable e) + { + return false; + } + } + + private String replace(String content, String key, String value) + { + return content.replaceAll(Pattern.quote(key), Matcher.quoteReplacement(value)); + } + + private int system(File wd, String... command) throws IOException, InterruptedException + { + Process process = Runtime.getRuntime().exec(command, null, wd); + process.getOutputStream().close(); + drain(command[0], process.getInputStream(), context.out); + drain(command[0], process.getErrorStream(), context.err); + process.waitFor(); + return process.exitValue(); + } + + private void drain(String threadName, final InputStream is, final OutputStream os) + { + new Thread(threadName) + { + { + setDaemon(true); + } + + @Override + public void run() + { + try + { + copy(is, os); + } + catch (Throwable e) + { + } + } + }.start(); + } + + private void copy(InputStream is, OutputStream os) throws IOException + { + byte[] buffer = new byte[1024 * 4]; + int c = is.read(buffer); + while (c >= 0) + { + os.write(buffer, 0, c); + c = is.read(buffer); + } + } + +} http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java index e48a5a5..3c75a8f 100644 --- a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java +++ b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Run.java @@ -40,7 +40,7 @@ import java.util.TimerTask; public class Run implements Action { - @Arguments(description = "Broker Configuration URI, default 'xml:${ACTIVEMQ_HOME}/config/non-clustered/bootstrap.xml'") + @Arguments(description = "Broker Configuration URI, default 'xml:${ACTIVEMQ_INSTANCE}/etc/bootstrap.xml'") String configuration; private ArrayList<ActiveMQComponent> components = new ArrayList<>(); @@ -55,12 +55,12 @@ public class Run implements Action /* 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.home").replace("\\", "/"); - System.setProperty("activemq.home", activemqHome); + String activemqInstance = System.getProperty("activemq.instance").replace("\\", "/"); + System.setProperty("activemq.instance", activemqInstance); if (configuration == null) { - configuration = "xml:" + activemqHome + "/config/non-clustered/bootstrap.xml"; + configuration = "xml:" + activemqInstance + "/etc/bootstrap.xml"; } // To support Windows paths as explained above. @@ -89,7 +89,7 @@ public class Run implements Action { Class clazz = this.getClass().getClassLoader().loadClass(componentDTO.componentClassName); ExternalComponent component = (ExternalComponent)clazz.newInstance(); - component.configure(componentDTO, activemqHome); + component.configure(componentDTO, activemqInstance); component.start(); components.add(component); } http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Stop.java ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Stop.java b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Stop.java index 26b2c34..225f4bf 100644 --- a/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Stop.java +++ b/activemq-bootstrap/src/main/java/org/apache/activemq/cli/commands/Stop.java @@ -27,7 +27,7 @@ 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_HOME}/config/non-clustered/bootstrap.xml'") + @Arguments(description = "Broker Configuration URI, default 'xml:${ACTIVEMQ_INSTANCE}/etc/bootstrap.xml'") String configuration; @Override @@ -36,12 +36,12 @@ public class Stop implements Action /* 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.home").replace("\\", "/"); - System.setProperty("activemq.home", activemqHome); + String activemqHome = System.getProperty("activemq.instance").replace("\\", "/"); + System.setProperty("activemq.instance", activemqHome); if (configuration == null) { - configuration = "xml:" + activemqHome + "/config/non-clustered/bootstrap.xml"; + configuration = "xml:" + activemqHome + "/etc/bootstrap.xml"; } // To support Windows paths as explained above. http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq new file mode 100755 index 0000000..ba87e09 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq @@ -0,0 +1,125 @@ +#!/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" +CLASSPATH="" + +# Load Profile Data +. "$ACTIVEMQ_INSTANCE/etc/activemq.profile" + +# Optionally load jars installed in the instance directory. +if [ -d $ACTIVEMQ_INSTANCE/lib ] ; then + for i in `ls $ACTIVEMQ_INSTANCE/lib/*.jar`; do + CLASSPATH=$CLASSPATH:$i + done +fi + +for i in `ls $ACTIVEMQ_HOME/lib/*.jar`; do + CLASSPATH=$CLASSPATH:$i +done + +# 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"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +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 + +JAVA_ARGS="$JAVA_ARGS $ACTIVEMQ_CLUSTER_PROPS + -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" + +exec "$JAVACMD" $JAVA_ARGS -classpath $CLASSPATH org.apache.activemq.cli.ActiveMQ $@ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq-service ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq-service b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq-service new file mode 100755 index 0000000..84235c9 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq-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 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-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq.cmd ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq.cmd b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq.cmd new file mode 100755 index 0000000..d88ba0c --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/activemq.cmd @@ -0,0 +1,72 @@ +@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=-Xmx1024M +set ACTIVEMQ_LOGGING_CONF="file:%ACTIVEMQ_INSTANCE%\config\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% -classpath %ACTIVEMQ_INSTANCE%\lib\* -Dactivemq.home=%ACTIVEMQ_HOME% -Dactivemq.instance=%ACTIVEMQ_INSTANCE% -Djava.io.tmpdir=%ACTIVEMQ_INSTANCE%/tmp -Ddata.dir=%ACTIVEMQ_DATA_DIR% -Djava.util.logging.manager=%ACTIVEMQ_LOG_MANAGER% -Dlogging.configuration=%ACTIVEMQ_LOGGING_CONF% -Djava.library.path=%ACTIVEMQ_INSTANCE%\lib\ + +rem "Set Debug & Cluster props" +if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS% +if not "%ACTIVEMQ_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ACTIVEMQ_CLUSTER_PROPS% + +"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.cli.ActiveMQ %* + +:END +endlocal +GOTO :EOF + +:EOF http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/run.bat ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/run.bat b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/run.bat new file mode 100755 index 0000000..a617b89 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/run.bat @@ -0,0 +1,17 @@ +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. +activemq.cmd run %* http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/run.sh ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/run.sh b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/run.sh new file mode 100755 index 0000000..7235fd9 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/run.sh @@ -0,0 +1,19 @@ +#!/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. + +`dirname "$0"`/activemq run $@ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/stop.bat ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/stop.bat b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/stop.bat new file mode 100755 index 0000000..653e7b3 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/stop.bat @@ -0,0 +1,17 @@ +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. +activemq.cmd stop %* http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/stop.sh ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/stop.sh b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/stop.sh new file mode 100755 index 0000000..fd4ead0 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/bin/stop.sh @@ -0,0 +1,19 @@ +#!/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. + +`dirname "$0"`/activemq stop $@ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-configuration.xml ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-configuration.xml b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-configuration.xml new file mode 100644 index 0000000..9f9489a --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-configuration.xml @@ -0,0 +1,81 @@ +<?xml version='1.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. +--> + +<configuration xmlns="urn:activemq" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd"> + <jms xmlns="urn:activemq:jms"> + <queue name="DLQ"/> + <queue name="ExpiryQueue"/> + </jms> + <core xmlns="urn:activemq:core"> + <paging-directory>${data.dir:../data}/paging</paging-directory> + + <bindings-directory>${data.dir:../data}/bindings</bindings-directory> + + <journal-directory>${data.dir:../data}/journal</journal-directory> + + <journal-min-files>10</journal-min-files> + + <large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory> + + <connectors> + <!-- Default Connector. Returned to clients during broadcast and distributed around cluster. See broadcast and discovery-groups --> + <connector name="activemq">tcp://${activemq.remoting.default.host:localhost}:${activemq.remoting.default.port:61616}</connector> + </connectors> + + <acceptors> + <!-- Default ActiveMQ Acceptor. Multi-protocol adapter. Currently supports Core, OpenWire, Stomp and AMQP. --> + <acceptor name="activemq">tcp://${activemq.remoting.default.host:localhost}:${activemq.remoting.default.port:61616}</acceptor> + + <!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.--> + <acceptor name="amqp">tcp://${activemq.remoting.amqp.host:localhost}:${activemq.remoting.amqp.port:5672}?protocols=AMQP</acceptor> + + <!-- STOMP Acceptor. --> + <acceptor name="stomp">tcp://${activemq.remoting.stomp.host:localhost}:${activemq.remoting.stomp.port:61613}?protocols=STOMP</acceptor> + + <!-- HornetQ Compatibility Acceptor. Enables ActiveMQ Core and STOMP for legacy HornetQ clients. --> + <acceptor name="hornetq">tcp://${activemq.remoting.hornetq.host:localhost}:${activemq.remoting.hornetq.port:5445}?protocols=CORE,STOMP</acceptor> + </acceptors> + + ${cluster.settings}${replicated.settings}${shared-store.settings} + + <security-settings> + <security-setting match="#"> + <permission type="createNonDurableQueue" roles="guest"/> + <permission type="deleteNonDurableQueue" roles="guest"/> + <permission type="consume" roles="guest"/> + <permission type="send" roles="guest"/> + </security-setting> + </security-settings> + + <address-settings> + <!--default for catch all--> + <address-setting match="#"> + <dead-letter-address>jms.queue.DLQ</dead-letter-address> + <expiry-address>jms.queue.ExpiryQueue</expiry-address> + <redelivery-delay>0</redelivery-delay> + <max-size-bytes>10485760</max-size-bytes> + <message-counter-history-day-limit>10</message-counter-history-day-limit> + <address-full-policy>BLOCK</address-full-policy> + </address-setting> + </address-settings> + </core> +</configuration> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-roles.properties ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-roles.properties b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-roles.properties new file mode 100644 index 0000000..4e2d44c --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-roles.properties @@ -0,0 +1,17 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- +guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-users.properties ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-users.properties b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-users.properties new file mode 100644 index 0000000..4e2d44c --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq-users.properties @@ -0,0 +1,17 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- +guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq.profile ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq.profile b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq.profile new file mode 100644 index 0000000..652ad11 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq.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. + +ACTIVEMQ_HOME='${activemq.home}' + +# Cluster Properties: Used to pass arguments to ActiveMQ which can be referenced in activemq-configuration.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-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq.profile.cmd ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq.profile.cmd b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq.profile.cmd new file mode 100644 index 0000000..37144e7 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/activemq.profile.cmd @@ -0,0 +1,37 @@ +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}' +set ACTIVEMQ_BASE='${activemq.base}' + +rem Path to logging configuration file +set ACTIVEMQ_LOGGING_CONF=file:%ACTIVEMQ_BASE%\etc\logging.properties + +rem Path to data directory +set ACTIVEMQ_DATA_DIR=%ACTIVEMQ_BASE%\data + +rem Log manager class +set ACTIVEMQ_LOG_MANAGER=org.jboss.logmanager.LogManager + +rem Cluster Properties: Used to pass arguments to ActiveMQ. These can be referenced in activemq-configuration.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 +set JAVA_ARGS=-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-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/bootstrap.xml ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/bootstrap.xml b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/bootstrap.xml new file mode 100644 index 0000000..1025f05 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/bootstrap.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + ~ 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. + --> + +<broker xmlns="http://activemq.org/schema"> + + <basic-security + users="file:${activemq.instance}/etc/activemq-users.properties" + roles="file:${activemq.instance}/etc/activemq-roles.properties" + default-user="guest" + /> + + <server configuration="file:${activemq.instance}/etc/activemq-configuration.xml"/> + + <web bind="http://localhost:8161" path="web"> + <app url="jolokia" war="jolokia-war-1.2.3.war"/> + </web> + +</broker> + http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/cluster-settings.txt ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/cluster-settings.txt b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/cluster-settings.txt new file mode 100644 index 0000000..7d9229c --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/cluster-settings.txt @@ -0,0 +1,25 @@ + + <broadcast-groups> + <broadcast-group name="bg-group1"> + <group-address>231.7.7.7</group-address> + <group-port>9876</group-port> + <broadcast-period>5000</broadcast-period> + <connector-ref>activemq</connector-ref> + </broadcast-group> + </broadcast-groups> + + <discovery-groups> + <discovery-group name="dg-group1"> + <group-address>231.7.7.7</group-address> + <group-port>9876</group-port> + <refresh-timeout>10000</refresh-timeout> + </discovery-group> + </discovery-groups> + + <cluster-connections> + <cluster-connection name="my-cluster"> + <address>jms</address> + <connector-ref>activemq</connector-ref> + <discovery-group-ref discovery-group-name="dg-group1"/> + </cluster-connection> + </cluster-connections> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/logging.properties ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/logging.properties b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/logging.properties new file mode 100644 index 0000000..066ac9c --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/logging.properties @@ -0,0 +1,51 @@ +# +# 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. +# + +# Additional logger names to configure (root logger is always configured) +# Root logger option +loggers=org.jboss.logging,org.apache.activemq.core.server,org.apache.activemq.utils,org.apache.activemq.journal,org.apache.activemq.jms.server,org.apache.activemq.integration.bootstrap + +# Root logger level +logger.level=INFO +# ActiveMQ logger levels +logger.org.apache.activemq.core.server.level=INFO +logger.org.apache.activemq.journal.level=INFO +logger.org.apache.activemq.utils.level=INFO +logger.org.apache.activemq.jms.level=INFO +logger.org.apache.activemq.integration.bootstrap.level=INFO +# Root logger handlers +logger.handlers=FILE,CONSOLE + +# Console handler configuration +handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler +handler.CONSOLE.properties=autoFlush +handler.CONSOLE.level=DEBUG +handler.CONSOLE.autoFlush=true +handler.CONSOLE.formatter=PATTERN + +# File handler configuration +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.formatter=PATTERN + +# Formatter pattern configuration +formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter +formatter.PATTERN.properties=pattern +formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %-5p [%c] %s%E%n http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/replicated-settings.txt ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/replicated-settings.txt b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/replicated-settings.txt new file mode 100644 index 0000000..db9faa0 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/replicated-settings.txt @@ -0,0 +1,6 @@ + + <ha-policy> + <replication> + <master/> + </replication> + </ha-policy> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/shared-store-settings.txt ---------------------------------------------------------------------- diff --git a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/shared-store-settings.txt b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/shared-store-settings.txt new file mode 100644 index 0000000..5901938 --- /dev/null +++ b/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/etc/shared-store-settings.txt @@ -0,0 +1,6 @@ + + <ha-policy> + <shared-store> + <master/> + </shared-store> + </ha-policy> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-dto/src/main/java/org/apache/activemq/dto/BasicSecurityDTO.java ---------------------------------------------------------------------- diff --git a/activemq-dto/src/main/java/org/apache/activemq/dto/BasicSecurityDTO.java b/activemq-dto/src/main/java/org/apache/activemq/dto/BasicSecurityDTO.java index 9b25d18..ee528ee 100644 --- a/activemq-dto/src/main/java/org/apache/activemq/dto/BasicSecurityDTO.java +++ b/activemq-dto/src/main/java/org/apache/activemq/dto/BasicSecurityDTO.java @@ -18,25 +18,25 @@ package org.apache.activemq.dto; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "basic-security") @XmlAccessorType(XmlAccessType.FIELD) public class BasicSecurityDTO extends SecurityDTO { - @XmlElement(required = true) + @XmlAttribute(required = true) public String users; - @XmlElement(required = true) + @XmlAttribute(required = true) public String roles; - @XmlElement(name = "default-user") + @XmlAttribute(name = "default-user") public String defaultUser; - @XmlElement(name = "mask-password") + @XmlAttribute(name = "mask-password") public Boolean maskPassword = false; - @XmlElement + @XmlAttribute public String passwordCodec; } http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/activemq-dto/src/main/java/org/apache/activemq/dto/XmlUtil.java ---------------------------------------------------------------------- diff --git a/activemq-dto/src/main/java/org/apache/activemq/dto/XmlUtil.java b/activemq-dto/src/main/java/org/apache/activemq/dto/XmlUtil.java index 3a6b1f4..5f9db1f 100644 --- a/activemq-dto/src/main/java/org/apache/activemq/dto/XmlUtil.java +++ b/activemq-dto/src/main/java/org/apache/activemq/dto/XmlUtil.java @@ -50,6 +50,7 @@ public class XmlUtil this.props = props; } + @Override public String getAttributeValue(int index) { return filter(super.getAttributeValue(index)); http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/distribution/activemq/src/main/resources/bin/activemq ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/bin/activemq b/distribution/activemq/src/main/resources/bin/activemq index ac08980..e15d094 100755 --- a/distribution/activemq/src/main/resources/bin/activemq +++ b/distribution/activemq/src/main/resources/bin/activemq @@ -96,19 +96,7 @@ for i in `ls $ACTIVEMQ_HOME/lib/*.jar`; do done # Set Defaults Properties -ACTIVEMQ_LOGGING_CONF="file:$ACTIVEMQ_HOME/config/logging.properties" -ACTIVEMQ_DATA_DIR=$ACTIVEMQ_HOME/data -ACTIVEMQ_LOG_MANAGER=org.jboss.logmanager.LogManager JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M" -# Load Runtime Config -if [ -z "$ACTIVEMQ_CONF" ] ; then - ACTIVEMQ_CONF=$ACTIVEMQ_HOME/bin/activemq.conf -else - ACTIVEMQ_CONF="$ACTIVEMQ_CONF" -fi -. $ACTIVEMQ_CONF - -JAVA_ARGS="$JAVA_ARGS $ACTIVEMQ_CLUSTER_PROPS -Dactivemq.home=$ACTIVEMQ_HOME -Djava.library.path=$ACTIVEMQ_HOME/bin/lib/linux-i686:$ACTIVEMQ_HOME/bin/lib/linux-x86_64 -Ddata.dir=$ACTIVEMQ_DATA_DIR -Djava.util.logging.manager=$ACTIVEMQ_LOG_MANAGER -Dlogging.configuration=$ACTIVEMQ_LOGGING_CONF $DEBUG_ARGS" - +JAVA_ARGS="$JAVA_ARGS -Dactivemq.home=$ACTIVEMQ_HOME" exec "$JAVACMD" $JAVA_ARGS -classpath $CLASSPATH org.apache.activemq.cli.ActiveMQ $@ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/distribution/activemq/src/main/resources/bin/activemq-service ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/bin/activemq-service b/distribution/activemq/src/main/resources/bin/activemq-service deleted file mode 100755 index 026944b..0000000 --- a/distribution/activemq/src/main/resources/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_BASE from the location of this script. -# -if [ -z "$ACTIVEMQ_BASE" ] ; 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_BASE=`dirname "$PRG"` - cd "$saveddir" - - # make it fully qualified - ACTIVEMQ_BASE=`cd "$ACTIVEMQ_BASE/.." && pwd` - export ACTIVEMQ_BASE - -fi - -PID_FILE="${ACTIVEMQ_BASE}/data/activemq.pid" - -if [ ! -d "${ACTIVEMQ_BASE}/data/" ]; then - mkdir "${ACTIVEMQ_BASE}/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_BASE}/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-6/blob/3c9e16fc/distribution/activemq/src/main/resources/bin/activemq.conf ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/bin/activemq.conf b/distribution/activemq/src/main/resources/bin/activemq.conf deleted file mode 100644 index fbfa243..0000000 --- a/distribution/activemq/src/main/resources/bin/activemq.conf +++ /dev/null @@ -1,34 +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. - -# Path to logging configuration file -ACTIVEMQ_LOGGING_CONF="file:$ACTIVEMQ_HOME/config/logging.properties" - -# Path to data directory -ACTIVEMQ_DATA_DIR=$ACTIVEMQ_HOME/data - -# Log manager class -ACTIVEMQ_LOG_MANAGER=org.jboss.logmanager.LogManager - -# Cluster Properties: Used to pass arguments to ActiveMQ which can be referenced in activemq-configuration.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-6/blob/3c9e16fc/distribution/activemq/src/main/resources/bin/activemq.conf.bat ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/bin/activemq.conf.bat b/distribution/activemq/src/main/resources/bin/activemq.conf.bat deleted file mode 100644 index c97ce3f..0000000 --- a/distribution/activemq/src/main/resources/bin/activemq.conf.bat +++ /dev/null @@ -1,34 +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. - -rem Path to logging configuration file -set ACTIVEMQ_LOGGING_CONF=file:%ACTIVEMQ_HOME%\config\logging.properties - -rem Path to data directory -set ACTIVEMQ_DATA_DIR=%ACTIVEMQ_HOME%\data - -rem Log manager class -set ACTIVEMQ_LOG_MANAGER=org.jboss.logmanager.LogManager - -rem Cluster Properties: Used to pass arguments to ActiveMQ. These can be referenced in activemq-configuration.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 -set JAVA_ARGS=-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-6/blob/3c9e16fc/distribution/activemq/src/main/resources/bin/run.bat ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/bin/run.bat b/distribution/activemq/src/main/resources/bin/run.bat deleted file mode 100755 index a617b89..0000000 --- a/distribution/activemq/src/main/resources/bin/run.bat +++ /dev/null @@ -1,17 +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. -activemq.cmd run %* http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/distribution/activemq/src/main/resources/bin/run.sh ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/bin/run.sh b/distribution/activemq/src/main/resources/bin/run.sh deleted file mode 100755 index 1010524..0000000 --- a/distribution/activemq/src/main/resources/bin/run.sh +++ /dev/null @@ -1,19 +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. - -./activemq run $@ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/distribution/activemq/src/main/resources/bin/stop.bat ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/bin/stop.bat b/distribution/activemq/src/main/resources/bin/stop.bat deleted file mode 100755 index 653e7b3..0000000 --- a/distribution/activemq/src/main/resources/bin/stop.bat +++ /dev/null @@ -1,17 +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. -activemq.cmd stop %* http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/distribution/activemq/src/main/resources/bin/stop.sh ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/bin/stop.sh b/distribution/activemq/src/main/resources/bin/stop.sh deleted file mode 100755 index 4d56530..0000000 --- a/distribution/activemq/src/main/resources/bin/stop.sh +++ /dev/null @@ -1,19 +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. - -./activemq stop $@ http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/distribution/activemq/src/main/resources/config/clustered/activemq-configuration.xml ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/config/clustered/activemq-configuration.xml b/distribution/activemq/src/main/resources/config/clustered/activemq-configuration.xml deleted file mode 100644 index 82c2557..0000000 --- a/distribution/activemq/src/main/resources/config/clustered/activemq-configuration.xml +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version='1.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. ---> - -<configuration xmlns="urn:activemq" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="urn:activemq /schema/activemq-configuration.xsd"> - <jms xmlns="urn:activemq:jms"> - <queue name="DLQ"/> - <queue name="ExpiryQueue"/> - </jms> - <core xmlns="urn:activemq:core"> - <paging-directory>${data.dir:../data}/paging</paging-directory> - - <bindings-directory>${data.dir:../data}/bindings</bindings-directory> - - <journal-directory>${data.dir:../data}/journal</journal-directory> - - <journal-min-files>10</journal-min-files> - - <large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory> - - <connectors> - <!-- Default Connector. Returned to clients during broadcast and distributed around cluster. See broadcast and discovery-groups --> - <connector name="activemq">tcp://${activemq.remoting.default.host:localhost}:${activemq.remoting.default.port:61616}</connector> - </connectors> - - <acceptors> - <!-- Default ActiveMQ Acceptor. Multi-protocol adapter. Currently supports Core, OpenWire, Stomp and AMQP. --> - <acceptor name="activemq">tcp://${activemq.remoting.default.host:localhost}:${activemq.remoting.default.port:61616}</acceptor> - - <!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.--> - <acceptor name="amqp">tcp://${activemq.remoting.amqp.host:localhost}:${activemq.remoting.amqp.port:5672}?protocols=AMQP</acceptor> - - <!-- STOMP Acceptor. --> - <acceptor name="stomp">tcp://${activemq.remoting.stomp.host:localhost}:${activemq.remoting.stomp.port:61613}?protocols=STOMP</acceptor> - - <!-- HornetQ Compatibility Acceptor. Enables ActiveMQ Core and STOMP for legacy HornetQ clients. --> - <acceptor name="hornetq">tcp://${activemq.remoting.hornetq.host:localhost}:${activemq.remoting.hornetq.port:5445}?protocols=CORE,STOMP</acceptor> - </acceptors> - - <broadcast-groups> - <broadcast-group name="bg-group1"> - <group-address>231.7.7.7</group-address> - <group-port>9876</group-port> - <broadcast-period>5000</broadcast-period> - <connector-ref>activemq</connector-ref> - </broadcast-group> - </broadcast-groups> - - <discovery-groups> - <discovery-group name="dg-group1"> - <group-address>231.7.7.7</group-address> - <group-port>9876</group-port> - <refresh-timeout>10000</refresh-timeout> - </discovery-group> - </discovery-groups> - - <cluster-connections> - <cluster-connection name="my-cluster"> - <address>jms</address> - <connector-ref>activemq</connector-ref> - <discovery-group-ref discovery-group-name="dg-group1"/> - </cluster-connection> - </cluster-connections> - - <security-settings> - <security-setting match="#"> - <permission type="createNonDurableQueue" roles="guest"/> - <permission type="deleteNonDurableQueue" roles="guest"/> - <permission type="consume" roles="guest"/> - <permission type="send" roles="guest"/> - </security-setting> - </security-settings> - - <address-settings> - <!--default for catch all--> - <address-setting match="#"> - <dead-letter-address>jms.queue.DLQ</dead-letter-address> - <expiry-address>jms.queue.ExpiryQueue</expiry-address> - <redelivery-delay>0</redelivery-delay> - <max-size-bytes>10485760</max-size-bytes> - <message-counter-history-day-limit>10</message-counter-history-day-limit> - <address-full-policy>BLOCK</address-full-policy> - </address-setting> - </address-settings> - </core> -</configuration> http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/distribution/activemq/src/main/resources/config/clustered/activemq-roles.properties ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/config/clustered/activemq-roles.properties b/distribution/activemq/src/main/resources/config/clustered/activemq-roles.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/distribution/activemq/src/main/resources/config/clustered/activemq-roles.properties +++ /dev/null @@ -1,17 +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. -## --------------------------------------------------------------------------- -guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/distribution/activemq/src/main/resources/config/clustered/activemq-users.properties ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/config/clustered/activemq-users.properties b/distribution/activemq/src/main/resources/config/clustered/activemq-users.properties deleted file mode 100644 index 4e2d44c..0000000 --- a/distribution/activemq/src/main/resources/config/clustered/activemq-users.properties +++ /dev/null @@ -1,17 +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. -## --------------------------------------------------------------------------- -guest=guest \ No newline at end of file http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/distribution/activemq/src/main/resources/config/clustered/bootstrap.xml ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/config/clustered/bootstrap.xml b/distribution/activemq/src/main/resources/config/clustered/bootstrap.xml deleted file mode 100644 index fd5ed54..0000000 --- a/distribution/activemq/src/main/resources/config/clustered/bootstrap.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<!-- - ~ 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. - --> - -<broker xmlns="http://activemq.org/schema"> - - <basic-security> - <users>file:${activemq.home}/config/non-clustered/activemq-users.properties</users> - <roles>file:${activemq.home}/config/non-clustered/activemq-roles.properties</roles> - <default-user>guest</default-user> - </basic-security> - - <server configuration="file:${activemq.home}/config/clustered/activemq-configuration.xml"/> - - <web bind="http://localhost:8161" path="web"> - <app url="jolokia" war="jolokia-war-1.2.3.war"/> - </web> - -</broker> - http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3c9e16fc/distribution/activemq/src/main/resources/config/examples/bootstrap.xml ---------------------------------------------------------------------- diff --git a/distribution/activemq/src/main/resources/config/examples/bootstrap.xml b/distribution/activemq/src/main/resources/config/examples/bootstrap.xml deleted file mode 100644 index a8762d1..0000000 --- a/distribution/activemq/src/main/resources/config/examples/bootstrap.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<!-- - ~ 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. - --> - -<broker xmlns="http://activemq.org/schema"> - - <basic-security> - <users>file:${activemq.home}/examples/jms/queue/src/main/resources/activemq/server0/activemq-users.properties</users> - <roles>file:${activemq.home}/examples/jms/queue/src/main/resources/activemq/server0/activemq-roles.properties</roles> - <default-user>guest</default-user> - </basic-security> - - <server configuration="file:${activemq.home}/examples/jms/queue/src/main/resources/activemq/server0/activemq-configuration.xml"/> - - <web bind="http://localhost:8161" path="web"> - <app url="jolokia" war="jolokia-war-1.2.3.war"/> - </web> - -</broker>
