#
# start-server
#
# Copyright 2001-2007 by Oracle. All rights reserved.
#
# Oracle is a registered trademarks of Oracle Corporation and/or its
# affiliates.
#
# This software is the confidential and proprietary information of Oracle
# Corporation. You shall not disclose such confidential and proprietary
# information and shall use it only in accordance with the terms of the
# license agreement you entered into with Oracle.
#
# This notice may not be removed or altered.
#

#!/bin/sh

case "$1" in
  master)  _PORT=7777 ; _SITE=master  ;;
  replica) _PORT=8888 ; _SITE=replica ;;
  *)      echo usage: start-server.sh [site name] ; exit ;;
esac

. ./set-env.sh

OPT="$OPT -Xms256m -Xmx256m"
OPT="$OPT -Dtangosol.coherence.clusterport=$_PORT"
OPT="$OPT -Dtangosol.coherence.cacheconfig=../config/$_SITE-cache-config.xml"

CLASSPATH=../classes
CLASSPATH=$CLASSPATH${CP_DELIM}$COHERENCE_HOME/lib/coherence.jar

$JAVA_HOME/bin/java -cp $CLASSPATH $OPT com.tangosol.net.DefaultCacheServer