Converting the GRIA client library into a DLL
IKVM.NET is an implementation of Java for Microsoft .NET Framework. It includes a Java Virtual Machine implemented in .NET and a .NET implementation of the Java class libraries. By using IKVM.NET we can use the GRIA client library (jar files) from .NET. As C# is very similar to Java, you can almost copy and paste your Java code into C# and run it. As well as IKVM.NET, "Jessie" must also be used. Jessie is an implementation of the Java Secure Sockets Extension (JSSE) and provides the core API for programming with Secure Sockets Layer (SSL).
Note: any Swing Interfaces you use from .NET (SwingIdentityProvider, InteractiveX509Trust, ...) will display but they look awful: no text and some strange icons. They still work but using them needs a guru like knowledge of the system!
Here is how to create a main GRIA DLL and a DLL for each of the client plugins:
- Download the GRIA 5.3.1 client and unzip.
- Download IKVM.NET and extract ikvmc.exe.
- From the GRIA client directory, run the following batch script (this is packaged with the client as "ikvm-compiler.bat" in GRIA 5.3.1). This may take several minutes with a lot of warning about duplicate classes etc. The resulting DLL files will be in the dll directory.
@echo off
REM This batch script will convert the GRIA libraries into a main DLL and additional DLLs for each plugin.
REM It requires the ikvmc.exe compiler from http://www.ikvm.net/
REM See http://www.gria.org/documentation/5.3/tutorial/using-the-gria-client-api-from.net for more information.
echo ============================== COMPILING GRIA DLL ==============================
echo.
echo This script takes quite a while to finish, please be patient!
echo This script requires the ikvmc.exe compiler from http://www.ikvm.net/
echo See http://www.gria.org/documentation/5.3/tutorial/using-the-gria-client-api-from.net
echo.
if exist dll RD /S /Q dll
if not exist dll MD dll
for %%x in ('DIR /B lib\*.jar') do COPY lib\%%x dll\%%x >NUL
if not exist dll\plugins MD dll\plugins
for /F %%x in ('DIR /B dll\gria-data-client*.jar dll\gria-job-client*.jar dll\gria-account-client*.jar
dll\gria-accesscontrol-client*.jar dll\gria-cltmgtregistry-client-*.jar dll\gria-membership-client-*.jar
dll\gria-ogsadai-client-*.jar dll\gria-sla-client-*.jar' ) do MOVE dll\%%x dll\plugins\%%x
ikvmc.exe -out:dll\gria.dll -target:library dll\*.jar > ikvm-gria-log.txt
for /F %%y in ('DIR /B dll\plugins\*.jar') do ikvmc.exe -target:library -out:dll\plugins\%%y.dll -reference:dll\gria.dll
dll\plugins\%%y >> ikvm-gria-log.txt
for /F %%z in ('DIR /B dll\plugins\*.dll') do MOVE dll\plugins\%%z dll\%%z
if exist dll\plugins RD /S /Q dll\plugins
for /F %%v in ('DIR /B dll\*.jar') do DEL dll\%%v
echo.
echo ============= FINISHED =============
echo The DLLs are in the 'dll' directory.
echo ====================================
- Download the jessie.jar: either the source code from the JESSIE web site or the binary from gria.org.
- Run IKVM.NET against the Jessie library:
ikvmc.exe -out:jessie.dll -target:library jessie.jar
