|
Running the program is easy. Simply modify the application configuration file on
each side so it specifies our chosen communication mechanism and its associated parameters.
The shared-memory communications channel will automatically cause a JVM to be created in the
same process as the .NET application when the .NET application starts, and the .NET code will
seamlessly and directly communicate with the Java code. If the Java side is on a different
machine from the .NET side, or if more than one .NET program will be accessing the Java code,
we can start up the JVM separately, and configure the two sides to communicate via a socket-based
communications channel. In either case, the .NET and Java code remain the same; only the
configuration information is changed.
In this tcp/binary example, we simply start up the .NET program.
Then we run the Java application.
Calls to the Java code will automatically be made, and the Java-side
console window will display logging messages originating on both the .NET and
the Java side.
|