Setting posix permissions is not supported on windows.

Use a boot jar to setup the classpath.
This commit is contained in:
Hiram Chirino 2015-04-15 19:55:28 -04:00
parent a1bdb3c02a
commit 3b82dc52ed
19 changed files with 322 additions and 173 deletions

46
activemq-boot/pom.xml Normal file
View File

@ -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>

View File

@ -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();
}
}
}

View File

@ -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)

View File

@ -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

View File

@ -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());

View File

@ -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);

View File

@ -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());
}

View File

@ -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 $@

View File

@ -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

View File

@ -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 %*

View File

@ -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 $@

View File

@ -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 %*

View File

@ -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 $@

View File

@ -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

View File

@ -37,6 +37,11 @@
<dependencies>
<!-- 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>

View File

@ -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>

View File

@ -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 $@

View File

@ -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

View File

@ -31,6 +31,7 @@
<modules>
<module>activemq-protocols</module>
<module>activemq-dto</module>
<module>activemq-boot</module>
</modules>
<name>ActiveMQ6 Parent</name>