#!/bin/bash

#
# Determine the directory of the current script and execute the
# set env script from there
#
BINDIR=$(cd $(dirname "$0"); pwd)
. ${BINDIR}/set-env.sh
if [ -z "$COH_HOME" ]; then
    echo Cannot run $0, environment not correctly set
    echo Please examine bin/set-env.sh and set OBE_HOME and COH_HOME
    kill -2 $$
fi

CLASSPATH=./config:${COH_HOME}/lib/coherence.jar:./classes:.

JVM_OPT="-server -Xms256m -Xmx256m"

SYS_OPT=-Dtangosol.coherence.clusterport=12358
SYS_OPT="$SYS_OPT -Dtangosol.coherence.ttl=0"
SYS_OPT="$SYS_OPT -Dtangosol.coherence.wka=localhost"
SYS_OPT="$SYS_OPT -Dtangosol.pof.enabled=true"
SYS_OPT="$SYS_OPT -Dtangosol.pof.config=${OBE_HOME}/config/pof-config.xml"
SYS_OPT="$SYS_OPT -Dtangosol.coherence.cacheconfig=${OBE_HOME}/config/cache-configuration.xml"
SYS_OPT="$SYS_OPT -Dtangosol.coherence.log.level=9"
java -cp $CLASSPATH $JVM_OPT $SYS_OPT com.tangosol.net.DefaultCacheServer

