activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject activemq-6 git commit: Setting posix permissions is not supported on windows. Use a boot jar to setup the classpath.
Date Fri, 17 Apr 2015 02:28:14 GMT
Repository: activemq-6
Updated Branches:
  refs/heads/master a1bdb3c02 -> 3b82dc52e


Setting posix permissions is not supported on windows.
Use a boot jar to setup the classpath.


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/3b82dc52
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/3b82dc52
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/3b82dc52

Branch: refs/heads/master
Commit: 3b82dc52ed8ddc4d2c42eff21ee20d6519edb8b8
Parents: a1bdb3c
Author: Hiram Chirino <hiram@hiramchirino.com>
Authored: Wed Apr 15 19:55:28 2015 -0400
Committer: Hiram Chirino <hiram@hiramchirino.com>
Committed: Thu Apr 16 22:10:35 2015 -0400

----------------------------------------------------------------------
 activemq-boot/pom.xml                           |  46 +++++++
 .../java/org/apache/activemq/boot/ActiveMQ.java | 136 +++++++++++++++++++
 .../java/org/apache/activemq/cli/ActiveMQ.java  |   1 -
 .../apache/activemq/cli/commands/Create.java    |  27 ++--
 .../org/apache/activemq/cli/commands/Run.java   |  17 ++-
 .../activemq/factory/BasicSecurityHandler.java  |  18 ++-
 .../apache/activemq/factory/BrokerFactory.java  |  22 ++-
 .../apache/activemq/cli/commands/bin/activemq   |  42 +++---
 .../activemq/cli/commands/bin/activemq.cmd      |  20 +--
 .../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.profile.cmd       |  16 +--
 distribution/activemq/pom.xml                   |   5 +
 distribution/activemq/src/main/assembly/dep.xml |  17 +++
 .../activemq/src/main/resources/bin/activemq    |  32 +++--
 .../src/main/resources/bin/activemq.cmd         |  23 +---
 pom.xml                                         |   1 +
 19 files changed, 322 insertions(+), 173 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/activemq-boot/pom.xml
----------------------------------------------------------------------
diff --git a/activemq-boot/pom.xml b/activemq-boot/pom.xml
new file mode 100644
index 0000000..bd931d0
--- /dev/null
+++ b/activemq-boot/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+   <modelVersion>4.0.0</modelVersion>
+
+   <parent>
+      <groupId>org.apache.activemq</groupId>
+      <artifactId>activemq-pom</artifactId>
+      <version>10.0.0-SNAPSHOT</version>
+      <relativePath>..</relativePath>
+   </parent>
+
+   <artifactId>activemq-boot</artifactId>
+   <packaging>jar</packaging>
+   <name>ActiveMQ6 Boot</name>
+
+   <properties>
+      <activemq.basedir>${project.basedir}/..</activemq.basedir>
+   </properties>
+
+   <dependencies>
+      <dependency>
+         <groupId>junit</groupId>
+         <artifactId>junit</artifactId>
+         <scope>test</scope>
+      </dependency>
+   </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/activemq-boot/src/main/java/org/apache/activemq/boot/ActiveMQ.java
----------------------------------------------------------------------
diff --git a/activemq-boot/src/main/java/org/apache/activemq/boot/ActiveMQ.java b/activemq-boot/src/main/java/org/apache/activemq/boot/ActiveMQ.java
new file mode 100644
index 0000000..afe965f
--- /dev/null
+++ b/activemq-boot/src/main/java/org/apache/activemq/boot/ActiveMQ.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.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.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-6/blob/3b82dc52/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 321ea98..64947c3 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
@@ -37,7 +37,6 @@ public class ActiveMQ
       Cli.CliBuilder<Action> builder = Cli.<Action>builder("activemq")
          .withDescription("ActiveMQ Command Line")
          .withCommand(HelpAction.class)
-         .withCommand(Create.class)
          .withDefaultCommand(HelpAction.class);
 
       if (instance != null)

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/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
index cc9b19c..1a30a84 100644
--- 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
@@ -110,14 +110,6 @@ public class Create implements Action
       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);
 
@@ -212,12 +204,19 @@ public class Create implements Action
 
    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
-      )));
+      try
+      {
+         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
+         )));
+      }
+      catch (Throwable ignore)
+      {
+         // Our best effort was not good enough :)
+      }
    }
 
    String path(String value, boolean unixPaths) throws IOException

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/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 3c75a8f..b238d8a 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
@@ -46,6 +46,16 @@ public class Run implements Action
 
    private Broker server;
 
+   static String fixupFileURI(String value)
+   {
+      if (value != null && value.startsWith("file:"))
+      {
+         value = value.substring("file:".length());
+         value = new File(value).toURI().toString();
+      }
+      return value;
+   }
+
    @Override
    public Object execute(ActionContext context) throws Exception
    {
@@ -60,17 +70,16 @@ public class Run implements Action
 
       if (configuration == null)
       {
-         configuration = "xml:" + activemqInstance + "/etc/bootstrap.xml";
+         File xmlFile = new File(new File(new File(activemqInstance), "etc"), "bootstrap.xml");
+         configuration = "xml:" + xmlFile.toURI().toString().substring("file:".length());
       }
 
       // To support Windows paths as explained above.
-      configuration = configuration.replace("\\", "/");
-
       System.out.println("Loading configuration file: " + configuration);
 
       BrokerDTO broker = BrokerFactory.createBrokerConfiguration(configuration);
 
-      String fileName = new URI(broker.server.configuration).getSchemeSpecificPart();
+      String fileName = new URI(fixupFileURI(broker.server.configuration)).getSchemeSpecificPart();
 
       addShutdownHook(new File(fileName).getParentFile());
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/activemq-bootstrap/src/main/java/org/apache/activemq/factory/BasicSecurityHandler.java
----------------------------------------------------------------------
diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/factory/BasicSecurityHandler.java
b/activemq-bootstrap/src/main/java/org/apache/activemq/factory/BasicSecurityHandler.java
index 20c7e6f..8d48013 100644
--- a/activemq-bootstrap/src/main/java/org/apache/activemq/factory/BasicSecurityHandler.java
+++ b/activemq-bootstrap/src/main/java/org/apache/activemq/factory/BasicSecurityHandler.java
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.factory;
 
+import java.io.File;
+
 import org.apache.activemq.core.config.impl.FileSecurityConfiguration;
 import org.apache.activemq.dto.BasicSecurityDTO;
 import org.apache.activemq.dto.SecurityDTO;
@@ -24,13 +26,25 @@ import org.apache.activemq.spi.core.security.ActiveMQSecurityManagerImpl;
 
 public class BasicSecurityHandler implements SecurityHandler
 {
+
+
+   static String fixupFileURI(String value)
+   {
+      if (value != null && value.startsWith("file:"))
+      {
+         value = value.substring("file:".length());
+         value = new File(value).toURI().toString();
+      }
+      return value;
+   }
+
    @Override
    public ActiveMQSecurityManager createSecurityManager(SecurityDTO security) throws Exception
    {
       BasicSecurityDTO fileSecurity = (BasicSecurityDTO) security;
       String home = System.getProperty("activemq.home");
-      FileSecurityConfiguration securityConfiguration = new FileSecurityConfiguration(fileSecurity.users.replace("${activemq.home}",
home).replace("\\", "/"),
-                                                                                      fileSecurity.roles.replace("${activemq.home}",
home).replace("\\", "/"),
+      FileSecurityConfiguration securityConfiguration = new FileSecurityConfiguration(fixupFileURI(fileSecurity.users),
+                                                                                      fixupFileURI(fileSecurity.roles),
                                                                                       fileSecurity.defaultUser,
                                                                                       fileSecurity.maskPassword,
                                                                                       fileSecurity.passwordCodec);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/activemq-bootstrap/src/main/java/org/apache/activemq/factory/BrokerFactory.java
----------------------------------------------------------------------
diff --git a/activemq-bootstrap/src/main/java/org/apache/activemq/factory/BrokerFactory.java
b/activemq-bootstrap/src/main/java/org/apache/activemq/factory/BrokerFactory.java
index ba11d56..cfa52d8 100644
--- a/activemq-bootstrap/src/main/java/org/apache/activemq/factory/BrokerFactory.java
+++ b/activemq-bootstrap/src/main/java/org/apache/activemq/factory/BrokerFactory.java
@@ -23,6 +23,7 @@ import org.apache.activemq.integration.Broker;
 import org.apache.activemq.spi.core.security.ActiveMQSecurityManager;
 import org.apache.activemq.utils.FactoryFinder;
 
+import java.io.File;
 import java.io.IOException;
 import java.net.URI;
 
@@ -40,9 +41,9 @@ public class BrokerFactory
       try
       {
          FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/broker/");
-         factory = (BrokerFactoryHandler)finder.newInstance(configURI.getScheme());
+         factory = (BrokerFactoryHandler) finder.newInstance(configURI.getScheme());
       }
-      catch (IOException ioe )
+      catch (IOException ioe)
       {
          throw new ConfigurationException("Invalid configuration URI, can't find configuration
scheme: " + configURI.getScheme());
       }
@@ -56,18 +57,29 @@ public class BrokerFactory
       return createBrokerConfiguration(new URI(configuration));
    }
 
+   static String fixupFileURI(String value)
+   {
+      if (value != null && value.startsWith("file:"))
+      {
+         value = value.substring("file:".length());
+         value = new File(value).toURI().toString();
+      }
+      return value;
+   }
+
    public static Broker createServer(ServerDTO brokerDTO, ActiveMQSecurityManager security)
throws Exception
    {
       if (brokerDTO.configuration != null)
       {
          BrokerHandler handler;
-         URI configURI = new URI(brokerDTO.configuration.replace("\\", "/"));
+         URI configURI = new URI(fixupFileURI(brokerDTO.configuration));
+
          try
          {
             FactoryFinder finder = new FactoryFinder("META-INF/services/org/apache/activemq/broker/server/");
-            handler = (BrokerHandler)finder.newInstance(configURI.getScheme());
+            handler = (BrokerHandler) finder.newInstance(configURI.getScheme());
          }
-         catch (IOException ioe )
+         catch (IOException ioe)
          {
             throw new ConfigurationException("Invalid configuration URI, can't find configuration
scheme: " + configURI.getScheme());
          }

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/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
index ba87e09..bca157b 100755
--- 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
@@ -46,24 +46,14 @@ fi
 
 # Set Defaults Properties
 ACTIVEMQ_LOGGING_CONF="file:$ACTIVEMQ_INSTANCE/etc/logging.properties"
-ACTIVEMQ_DATA_DIR=$ACTIVEMQ_INSTANCE/data
+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
+CLASSPATH="$ACTIVEMQ_HOME/lib/activemq-boot.jar"
 
 # OS specific support.
 cygwin=false;
@@ -86,8 +76,6 @@ if $cygwin ; then
     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
@@ -112,14 +100,20 @@ if [ ! -x "$JAVACMD" ] ; then
   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"
+if $cygwin ; then
+  JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
+  ACTIVEMQ_HOME=`cygpath --windows "$ACTIVEMQ_HOME"`
+  CLASSPATH=`cygpath --windows "$CLASSPATH"`
+fi
 
-exec "$JAVACMD" $JAVA_ARGS -classpath $CLASSPATH org.apache.activemq.cli.ActiveMQ $@
+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.boot.ActiveMQ $@

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/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
index d88ba0c..357b44d 100755
--- 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
@@ -48,22 +48,26 @@ 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 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% -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%
+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\activemq-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.cli.ActiveMQ %*
+"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.boot.ActiveMQ %*
 
 :END
 endlocal

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/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
deleted file mode 100755
index a617b89..0000000
--- a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/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/3b82dc52/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
deleted file mode 100755
index 7235fd9..0000000
--- a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/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.
-
-`dirname "$0"`/activemq run $@

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/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
deleted file mode 100755
index 653e7b3..0000000
--- a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/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/3b82dc52/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
deleted file mode 100755
index fd4ead0..0000000
--- a/activemq-bootstrap/src/main/resources/org/apache/activemq/cli/commands/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.
-
-`dirname "$0"`/activemq stop $@

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/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
index 37144e7..77800c8 100644
--- 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
@@ -15,23 +15,13 @@ 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}'
+set ACTIVEMQ_HOME=${activemq.home}
 
-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 Cluster Properties: Used to pass arguments to ActiveMQ which 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 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-6/blob/3b82dc52/distribution/activemq/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/activemq/pom.xml b/distribution/activemq/pom.xml
index a3ba77b..6cfe7d0 100644
--- a/distribution/activemq/pom.xml
+++ b/distribution/activemq/pom.xml
@@ -39,6 +39,11 @@
      <!-- ActiveMQ artifacts -->
       <dependency>
          <groupId>org.apache.activemq</groupId>
+         <artifactId>activemq-boot</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
+         <groupId>org.apache.activemq</groupId>
          <artifactId>activemq-server</artifactId>
          <version>${project.version}</version>
       </dependency>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/distribution/activemq/src/main/assembly/dep.xml
----------------------------------------------------------------------
diff --git a/distribution/activemq/src/main/assembly/dep.xml b/distribution/activemq/src/main/assembly/dep.xml
index 5d0b21a..c792469 100644
--- a/distribution/activemq/src/main/assembly/dep.xml
+++ b/distribution/activemq/src/main/assembly/dep.xml
@@ -26,9 +26,26 @@
       <format>tar.gz</format>
    </formats>
    <includeBaseDirectory>true</includeBaseDirectory>
+
+
    <dependencySets>
       <dependencySet>
+        <directoryMode>755</directoryMode>
+        <fileMode>644</fileMode>
+        <outputDirectory>lib</outputDirectory>
+        <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
+        <unpack>false</unpack>
+        <useTransitiveDependencies>false</useTransitiveDependencies>
+        <includes>
+           <include>org.apache.activemq:activemq-boot</include>
+        </includes>
+      </dependencySet>
+
+      <dependencySet>
+         <directoryMode>755</directoryMode>
+         <fileMode>644</fileMode>
          <includes>
+
             <!-- modules -->
             <include>org.apache.activemq:activemq-bootstrap</include>
             <include>org.apache.activemq:activemq-commons</include>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/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 e15d094..4b99fd6 100755
--- a/distribution/activemq/src/main/resources/bin/activemq
+++ b/distribution/activemq/src/main/resources/bin/activemq
@@ -44,6 +44,10 @@ if [ -z "$ACTIVEMQ_HOME" ] ; then
   ACTIVEMQ_HOME=`cd "$ACTIVEMQ_HOME/.." && pwd`
 fi
 
+# Set Defaults Properties
+JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M"
+CLASSPATH="$ACTIVEMQ_HOME/lib/activemq-boot.jar"
+
 # OS specific support.
 cygwin=false;
 darwin=false;
@@ -53,10 +57,10 @@ case "`uname`" in
     export OSTYPE
     ;;
   Darwin*) darwin=true
-           if [ -z "$JAVA_HOME" ] ; then
-             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
-           fi
-           ;;
+    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
@@ -65,8 +69,6 @@ if $cygwin ; then
     ACTIVEMQ_HOME=`cygpath --unix "$ACTIVEMQ_HOME"`
   [ -n "$JAVA_HOME" ] &&
     JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-  [ -n "$CLASSPATH" ] &&
-    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
 fi
 
 if [ -z "$JAVACMD" ] ; then
@@ -91,12 +93,16 @@ if [ ! -x "$JAVACMD" ] ; then
   exit 1
 fi
 
-for i in `ls $ACTIVEMQ_HOME/lib/*.jar`; do
-	CLASSPATH=$i:$CLASSPATH
-done
 
-# Set Defaults Properties
-JAVA_ARGS="-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M -Xmx1024M"
+if $cygwin ; then
+  JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
+  ACTIVEMQ_HOME=`cygpath --windows "$ACTIVEMQ_HOME"`
+  CLASSPATH=`cygpath --windows "$CLASSPATH"`
+fi
 
-JAVA_ARGS="$JAVA_ARGS -Dactivemq.home=$ACTIVEMQ_HOME"
-exec "$JAVACMD" $JAVA_ARGS -classpath $CLASSPATH org.apache.activemq.cli.ActiveMQ $@
+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.boot.ActiveMQ $@

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/distribution/activemq/src/main/resources/bin/activemq.cmd
----------------------------------------------------------------------
diff --git a/distribution/activemq/src/main/resources/bin/activemq.cmd b/distribution/activemq/src/main/resources/bin/activemq.cmd
index d503a27..8ab6163 100755
--- a/distribution/activemq/src/main/resources/bin/activemq.cmd
+++ b/distribution/activemq/src/main/resources/bin/activemq.cmd
@@ -48,27 +48,16 @@ echo.
 :RUN_JAVA
 
 rem "Set Defaults."
-set JAVA_ARGS=-Xmx1024M
-set ACTIVEMQ_LOGGING_CONF="file:%ACTIVEMQ_HOME%\config\logging.properties"
-set ACTIVEMQ_DATA_DIR="%ACTIVEMQ_HOME%\data"
-set ACTIVEMQ_LOG_MANAGER=org.jboss.logmanager.LogManager
-
-rem "Load Config"
-if "%ACTIVEMQ_CONF%" == "" set ACTIVEMQ_CONF="%ACTIVEMQ_HOME%\bin\activemq.conf.bat"
-if exist "%ACTIVEMQ_CONF%" (
-   call "%ACTIVEMQ_CONF%" %*
-) else (
-   echo Config file not found "%ACTIVEMQ_CONF%"
-)
+set JAVA_ARGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Xms512M
-Xmx1024M
 
 rem "Create full JVM Args"
-set JVM_ARGS=%JAVA_ARGS% -classpath %ACTIVEMQ_HOME%\lib\* -Dactivemq.home=%ACTIVEMQ_HOME%
-Ddata.dir=%ACTIVEMQ_DATA_DIR% -Djava.util.logging.manager=%ACTIVEMQ_LOG_MANAGER% -Dlogging.configuration=%ACTIVEMQ_LOGGING_CONF%
-Djava.library.path=%ACTIVEMQ_HOME%\lib\
-
-rem "Set Debug & Cluster props"
-if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_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\activemq-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.cli.ActiveMQ %*
+"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.boot.ActiveMQ %*
 
 :END
 endlocal

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/3b82dc52/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c1e5b1b..0f3680c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,6 +31,7 @@
    <modules>
       <module>activemq-protocols</module>
       <module>activemq-dto</module>
+      <module>activemq-boot</module>
    </modules>
 
    <name>ActiveMQ6 Parent</name>


Mime
View raw message