#!/bin/sh
# ---------------------------------------------------------------------------
# JOnAS: Java(TM) Open Application Server
# Copyright (C) 1999 Bull S.A.
# Contact: jonas-team@objectweb.org
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or any later version.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
# USA
#
# ---------------------------------------------------------------------------
# $Id$
# ---------------------------------------------------------------------------

#
# Usage:	ser1
#
# This script allows to launch a EJB Server with a correct environment for the jonas-test
#
# You MUST UPDATE the DATASOURCES list with YOUR datasources before using it.
# Actually, the jonas_test need only one datasource and its 'datasource.name' MUST BE jdbc_1
#

DATASOURCES="PostgreSQL1"

if [ ! -f $JONAS_ROOT/bin/unix/config_env ]
then
    echo "JONAS_ROOT must be set"
    exit 1
fi
. $JONAS_ROOT/bin/unix/config_env


# Set JMS environment
if [ -z "$JMS_CONF_DIR" ]
then
    JMS_CONF_DIR=$JONAS_ROOT/config
fi


# EJBServer launching with the specific environment to the jonas_test
xterm -title EJB -geometry 120x20 -sb -e java \
    -Dinstall.root=$JONAS_ROOT \
    -Djava.security.policy=$JONAS_ROOT/config/java.policy \
    -Djonas.name=EJB \
    -Djonas.services=jmx,security,jtm,dbm,jms,ejb \
    -Djonas.service.dbm.datasources=$DATASOURCES \
    -Djonas.service.jtm.remote=false \
    -Djonas.service.jms.collocated=true \
    -Dfr.dyade.aaa.agent.A3CONF_DIR=$JMS_CONF_DIR \
    -Djonas.service.jms.topics=JunitTopic1,JunitTopic2 \
    -Djonas.service.jms.queues=JunitQueue1,JunitQueue2,JunitQueue3 \
    org.objectweb.jonas.server.Server &
