Introduction to J-Integra® Native Mode

Contents

Introduction

Until the 1.3.2 release, the J-Integra® Java-COM bridge only supported the use of network based DCOM to allow Java objects to interact with COM objects.

This release gives you an alternative; as J-Integra® can now use native code (DLLs) to perform the bridging.

Please Note that you do not have to use the new native mode. By default, J-Integra® uses DCOM: and the native mode must be explicitly enabled.

Your Java code stays the same whether it is using native mode or DCOM mode. For this reason, please consult the standard J-Integra® documentation for a general overview of J-Integra®.

What is supported?

Both IDispatch and vtable

The native mode supports both IDispatch and Custom (vtable) method invocations, in both directions. The COM interfaces do not have to be dual (they can derive directly from IUnknown).

In-process and out-of-process

J-Integra®'s native mode supports:

Microsoft Transaction Server / COM+

We have successfully loaded a Java object into MTS (in-process) and invoked methods on it from a VB base client.

We have made the Java object implement the standard IObjectControl COM interface (which it saw as a normal Java interface, generated by 'com2java'), and MTS invoked the usual methods (activate, canBePooled, etc.).

Finally, using a special hook in the J-Integra® runtime, we have accessed the IObjectContext MTS/COM+ interface from the Java object and tested some of the attributes. It correctly detected when it was operating in a transaction, for example.

Click here for more information, including step-by-step examples of the above.

Structs as Parameters

As of v2.0, J-Integra® supports passing COM structs as parameters to COM methods in native mode. However, there are certain limitations:

  1. The struct parameter cannot contain an embedded struct (ie, a struct containing a struct).
  2. The struct parameter can only contain basic types (ie, long, double, BSTR, etc). It cannot contain complex types such as VARIANTs, IDispatch pointers, etc.
  3. VARIANT parameters cannot contain structs.

Threading Models

J-Integra® supports both Multi-threaded (also called Free Threads or Multi-threaded Apartment - MTA) and Apartment-threaded (also called Single Threaded Apartment - STA) models. You can use J-Integra® runtime property, JINTEGRA_COINIT_VALUE, to set the threading models. See the related topic How to Run Java Clients in Native Mode (COM Component In-process or Out-of-process).

Related Topics