jmsclient.bat 2.68 KB
Newer Older
afreyssin's avatar
afreyssin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
REM Copyright (C) 2000 - 2012 ScalAgent Distributed Technologies
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.

afreyssin's avatar
afreyssin committed
18 19
@echo off
REM Verify if JORAM_HOME is well defined
20
if not exist "%JORAM_HOME%\samples\bin\clean.bat" goto nokHome
afreyssin's avatar
afreyssin committed
21 22 23 24 25 26 27
REM Verify if JAVA_HOME is well defined
if not exist "%JAVA_HOME%\bin\java.exe" goto nokJava
REM Test the argument number
if [%1]==[] goto no_arg
if not [%2]==[]  goto too_many_args

set CONFIG_DIR=%JORAM_HOME%\samples\config
Guillaume Surrel's avatar
Guillaume Surrel committed
28
set JORAM_BUNDLES=%JORAM_HOME%\ship\bundle
afreyssin's avatar
afreyssin committed
29 30 31
set RUN_DIR=%JORAM_HOME%\samples\run
set SAMPLE_CLASSES=%JORAM_HOME%\samples\classes\joram

Guillaume Surrel's avatar
Guillaume Surrel committed
32 33 34 35
if not exist "%RUN_DIR%" goto nokRunDir

cp %CONFIG_DIR%\a3debug.cfg %RUN_DIR%\a3debug.cfg
cp %CONFIG_DIR%\jndi.properties %RUN_DIR%\jndi.properties
afreyssin's avatar
afreyssin committed
36 37

REM  Building the Classpath
Guillaume Surrel's avatar
Guillaume Surrel committed
38 39 40
set CLASSPATH=%JORAM_BUNDLES%\a3-common.jar
set CLASSPATH=%CLASSPATH%;%JORAM_BUNDLES%\jndi-client.jar
set CLASSPATH=%CLASSPATH%;%JORAM_BUNDLES%\jndi-shared.jar
41
set CLASSPATH=%CLASSPATH%;%JORAM_BUNDLES%\ow2-jms-2.0-spec.jar
Guillaume Surrel's avatar
Guillaume Surrel committed
42 43 44 45
set CLASSPATH=%CLASSPATH%;%JORAM_BUNDLES%\joram-client-jms.jar
set CLASSPATH=%CLASSPATH%;%JORAM_BUNDLES%\joram-shared.jar
set CLASSPATH=%CLASSPATH%;%JORAM_BUNDLES%\jcup.jar
set CLASSPATH=%CLASSPATH%;%JORAM_BUNDLES%\monolog.jar
afreyssin's avatar
afreyssin committed
46 47 48
set CLASSPATH=%CLASSPATH%;%SAMPLE_CLASSES%
set CLASSPATH=%CLASSPATH%;%RUN_DIR%

49 50
set PATH=%JAVA_HOME%\bin;%PATH%

afreyssin's avatar
afreyssin committed
51
echo == Launching the %1 client ==
52
start /D %RUN_DIR% /B java -classpath %CLASSPATH% %1
afreyssin's avatar
afreyssin committed
53 54 55 56 57 58 59 60 61 62 63 64 65
goto end
:nokHome
echo The JORAM_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:nokJava
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:nokRunDir
echo You must first launch servers to create run directory.
goto end
:no_arg
66
echo !! Missing classname argument: compile samples and try 'classic.ClassicAdmin', 'classic.Sender' and 'classic.Receiver' for example !!
afreyssin's avatar
afreyssin committed
67 68 69 70 71 72 73
goto usage
:too_many_args
echo !! Too many arguments !!
goto usage
:usage
echo jmsclient <classname>
:end