@echo off
setlocal

set installDir=%~dp0..

echo.
echo Starting Tax Provider Bridge...

set /p busComponent= < "%installDir%"\etc\buscomponent.cfg
set javaClass=com.eibus.java.james.James
set javaFlags="-Dcom.ssa.ta.taxprovider.install.dir=%installDir%" "-Djava.util.logging.config.file=%installDir%\etc\logging.properties"
set classPathPrefix=%installDir%\etc
set classPathPrefix=%classPathPrefix%;%installDir%\lib\ow-tpbridge.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\jaxb-api.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\jaxb-impl.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\jaxb-libs.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\jax-qname.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\namespace.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\relaxngDatatype.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\saaj-api.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\saaj-impl.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\jaxp-api.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\dom.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\sax.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\xalan.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\xercesImpl.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\activation.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\jaxrpc-api.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\jaxrpc-impl.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\jaxrpc-spi.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\mail.jar
set classPathPrefix=%classPathPrefix%;%installDir%\lib\jsr173_api.jar
cd /d "%installDir%"\etc
if "%1" == "" (
 echo Using bus component %busComponent%
 call "%installDir%"\bin\launchJava.bat %busComponent%
) else (
 echo Using bus component %1
 call "%installDir%"\bin\launchJava.bat %*
)
if errorlevel 1 (
 exit /b 1
)

endlocal
