#!/bin/sh

. /etc/rc.common

##
# Start up the OpenJMS server on Mac OS X / Darwin
#
# 2002-12-29  Tatsuya Kawano <tatsuyak@mac.com>
#             First version
##

# Replace this with the one that you actually use. 
CONFIG_FILE="rmi_jms_jdbm.xml"


export JAVA_HOME=/Library/Java/Home
export OPENJMS_HOME=/usr/local/openjms

StartService ()
{
	ConsoleMessage "Starting OpenJMS Server"

	cd $OPENJMS_HOME/bin
	$OPENJMS_HOME/bin/startjms.sh -config $OPENJMS_HOME/config/$CONFIG_FILE & 
}

StopService()
{
	ConsoleMessage "Stopping OpenJMS Server"

	cd $OPENJMS_HOME/bin
	$OPENJMS_HOME/bin/admin.sh -config $OPENJMS_HOME/config/$CONFIG_FILE -stopServer 
}

RestartService ()
{
	StopService
	StartService
}


RunService "$1"
