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

Rem Keep variables local to this script
setlocal

Rem check JONAS_ROOT and JONAS_BASE
if [%JONAS_ROOT%]==[] goto setroot
Rem Required for carol.properties file (add JONAS_BASE\conf to classpath)
call %JONAS_ROOT%\bin\nt\setenv.bat
set JONAS_LIB=%JONAS_ROOT%\lib

Rem ---------------------------------------------
Rem Get args
Rem ---------------------------------------------
:loop_on_args
if %1==-cp     goto cp_arg
set ARGS=%ARGS% %1
goto next_arg

:cp_arg
shift
Set CLASSPATH=%CLASSPATH%;%1
goto next_arg

:next_arg
shift
if not [%1]==[] goto loop_on_args

if not exist %JONAS_LIB%\client.jar goto manyjars
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\client.jar
goto setex

:manyjars
Rem Clients may use all these
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\ow_jonas_bootstrap.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\j2ee\ejb\ejb-2_1-api.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\j2ee\jaas\jaas1_0.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\j2ee\jndi\jndi.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\j2ee\jta\jta-spec1_0_1.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\j2ee\jts\jts-spec1_0.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\j2ee\providerutil\providerutil.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\j2ee\jms\jms.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\jmx\jmx\jmxri.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\joram\mom\mom.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\joram\joram\joram.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\joram\JCup\JCup.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\log\ow_monolog.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\log\log4j\log4j.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\connector\ow_tx_api.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\carol\carol.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\jonathan\jonathan.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\jonathan\kilim.jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\jonathan\nanoxml-lite-2.2.1.jar


Rem should only put here a minimum client jar
Set CLASSPATH=%CLASSPATH%;%JONAS_LIB%\common\ow_jonas.jar

:setex
set CLASSPATH=%CLASSPATH%;%JONAS_ROOT%\examples\classes
goto :opt_orb

:opt_orb
Rem ---------------------------------------------
Rem Set options for ORB
Rem ---------------------------------------------
set JAVA_OPTS=%JAVA_OPTS% -Djavax.rmi.CORBA.PortableRemoteObjectClass=org.objectweb.carol.rmi.multi.MultiPRODelegate -Djava.naming.factory.initial=org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory -Dorg.omg.PortableInterceptor.ORBInitializerClass.org.objectweb.jonas_tm.ots.OTSORBInitializer -Dorg.omg.PortableInterceptor.ORBInitializerClass.org.objectweb.jonas.security.interceptors.iiop.SecurityInitializer 
set JAVA_OPTS=%JAVA_OPTS% -Djava.security.auth.login.config=%JONAS_ROOT%\conf\jaas.config
%JAVA% %JAVA_OPTS% %ARGS%
goto :EOF

:setroot
echo JONAS_ROOT not set.
goto :EOF
