-
Notifications
You must be signed in to change notification settings - Fork 910
/
artemis
executable file
·99 lines (87 loc) · 2.79 KB
/
artemis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/env sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
if [ -z "$ARTEMIS_HOME" ] ; then
## resolve links - $0 may be a link to ActiveMQ's home
PRG="$0"
progname=`basename "$0"`
saveddir=`pwd`
# need this for relative symlinks
dirname_prg=`dirname "$PRG"`
cd "$dirname_prg"
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
ARTEMIS_HOME=`dirname "$PRG"`
cd "$saveddir"
# make it fully qualified
ARTEMIS_HOME=`cd "$ARTEMIS_HOME/.." && pwd`
fi
# Set Defaults JAVA_ARGS Properties if not already set: this allow specific artemis commands to override default JVM configuration
if [ -z "${JAVA_ARGS}" ]; then JAVA_ARGS="-Xms512M -Xmx1024M"; fi
CLASSPATH="$ARTEMIS_HOME/lib/artemis-boot.jar"
# OS specific support.
cygwin=false;
darwin=false;
case "`uname`" in
CYGWIN*) cygwin=true
OSTYPE=cygwin
export OSTYPE
;;
Darwin*) darwin=true
if [ -z "$JAVA_HOME" ] ; then
JAVA_HOME=$(/usr/libexec/java_home)
fi
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$ARTEMIS_HOME" ] &&
ARTEMIS_HOME=`cygpath --unix "$ARTEMIS_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD=java
fi
fi
if $cygwin ; then
JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
ARTEMIS_HOME=`cygpath --windows "$ARTEMIS_HOME"`
CLASSPATH=`cygpath --windows "$CLASSPATH"`
fi
exec "$JAVACMD" $JAVA_ARGS $ARTEMIS_CLUSTER_PROPS \
-classpath "$CLASSPATH" \
-Dartemis.home="$ARTEMIS_HOME" \
-Djava.library.path="$ARTEMIS_HOME/bin/lib/linux-$(uname -m)" \
$DEBUG_ARGS \
$JAVA_ARGS_APPEND \
org.apache.activemq.artemis.boot.Artemis "$@"