-
Notifications
You must be signed in to change notification settings - Fork 106
/
start.sh
executable file
·58 lines (45 loc) · 2.14 KB
/
start.sh
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
# start NS
# for orbd JDK 1.8 is needed
function startNS {
/usr/bin/orbd $PROG_ARGS
}
# start TM
function startTM {
export CLASSPATH="$NARAYANA_HOME/lib/jts\*"
DBGOPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
java $DBGOPTS -cp "$NARAYANA_HOME/lib/jts/*:$NARAYANA_HOME/lib/ext/*" $OPENJDKORBPROPS $NSPROPS com.arjuna.ats.jts.TransactionServer $PROG_ARGS
}
# start RM
function startRM {
java -cp "$NARAYANA_HOME/lib/jts/narayana-jts-idlj.jar:$NARAYANA_HOME/lib/ext/*" $OPENJDKORBPROPS $NSPROPS com.arjuna.ats.arjuna.recovery.RecoveryManager $PROG_ARGS
}
# start client
function startClient {
mvn compile exec:java -Dexec.cleanupDaemonThreads=false -Dexec.mainClass=org.jboss.narayana.jta.quickstarts.RemoteTMExample -DOrbPortabilityEnvironmentBean.orbImpleClassName="com.arjuna.orbportability.internal.orbspecific.javaidl.orb.implementations.javaidl_1_4" -DNAME_SERVER_HOST="$HOST_ADDRESS"
}
HOST_ADDRESS=${HOST_ADDRESS:-`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`}
if test "x$JAVA_HOME" = "x"; then
echo Please ensure the JAVA_HOME environment variable is set
exit 1
fi
if test "x$NARAYANA_HOME" = "x"; then
echo Please ensure the NARAYANA_HOME environment variable is set to the location of the narayana distribution
exit 1
fi
if test "x$HOST_ADDRESS" = "x"; then
echo Please ensure the HOST_ADDRESS environment variable is set to the IP address of one of your network interfaces
exit 1
fi
if [ $# -lt 1 ]; then
echo "syntax {NS | TM | RM | CL}"
exit 1
fi
PROG_ARGS="-ORBInitialHost $HOST_ADDRESS -ORBInitialPort 9999"
NSPROPS="-DOrbPortabilityEnvironmentBean.bindMechanism=NAME_SERVICE -DOrbPortabilityEnvironmentBean.resolveService=NAME_SERVICE"
OPENJDKORBPROPS="-DOrbPortabilityEnvironmentBean.orbDataClassName=com.arjuna.orbportability.internal.orbspecific.versions.javaidl_1_4 -DOrbPortabilityEnvironmentBean.orbImpleClassName=com.arjuna.orbportability.internal.orbspecific.javaidl.orb.implementations.javaidl_1_4"
case $1 in
"NS") echo "starting NS"; startNS ;;
"TM") echo "starting TM"; startTM ;;
"RM") echo "starting RM"; startRM ;;
"CL") echo "starting CL"; startClient ;;
esac