HOWTO: Create a Java COM server using Excelsior JET and Intrinsyc J-Integra
Article ID: 000021 PDF Version: 000021.pdf The information in this article applies to:
This document contains step-by-step instructions for using Excelsior JET to create a COM-accessible DLL/EXE from your Java code with the help of Intrinsyc’s J-Integra for COM. Java code may be integrated with code written in other languages via Java Native Interface (JNI). JNI is the standard mechanism designed by Sun to integrate Java with other languages. Unfortunately, using bare JNI for communication between Java and COM is quite complicated. There are several Java-to-COM bridges on the market which simplify such an integration. One of them is J-Integra for COM by Intrinsyc. This document describes how to use Excelsior JET and J-Integra for COM together to convert your Java components to COM-accessible Windows executables (EXE or DLL). If you are not a J-Integra for COM user, download a free evaluation version from: For more information about J-Integra for COM, refer to its online documentation: http://j-integra.intrinsyc.com/support/com/doc/.
First of all, you have to create a COM-accessible Java component using J-Integra for COM and make sure that it works properly on the Sun HotSpot JVM. Please refer to J-Integra documentation for instructions. The discussion below is based on the "J-Integra Visual C++ to Java" example described at http://j-integra.intrinsyc.com/support/com/doc/javafromcom/vc2java.html. It assumes that Java class files for this example are placed in D:\pure\vceb directory, and J-Integra for COM is installed in E:\jintegra.
On this step, you will use Excelsior JET to compile your Java code and the proxy classes produced by J-Integra’s java2com utility together into an out-of-process COM server (EXE file).
J-Integra-based COM server can be accessed from COM clients using three different mechanisms. This section describes how to invoke JET-compiled code using each of them. For more information, see: Register JVM: regjvmcmd vcebjvm localhost[1111] Create a script called e.g. run.bat: set JETVMPROP=-DJINTEGRA_DCOM_PORT:1111 and start it. Run the client executable (vcObserver.exe) and test the server. Note: You can hard-wire system property values into the executable file produced by JET to get rid of the run.bat script. You specify hard-wired properties on the Target page of the JET Control Panel. For details, see Excelsior JET User’s Guide, Chapter “Application considerations”, section “System properties”. Register JVM: regjvmcmd /native vcebjvm Create a script called e.g. run.bat: set JETVMPROP=-DJINTEGRA_NATIVE_MODE and start it. Run the client executable (vcObserver.exe) and test the server. Note: You can hard-wire system property values into the executable file produced by JET to get rid of the run.bat script. You specify hard-wired properties on the Target page of the JET Control Panel. For details, see Excelsior JET User’s Guide, Chapter “Application considerations”, section “System properties”.
Copyright © 2003-2006 Excelsior LLC. All rights reserved.
|
|
Home | Company | Products | Services | Resources | Blog | Contact | Request a Call Site: Search | Sitemap | Forum | Credits © 1999-2006 Excelsior LLC. All Rights Reserved. |