Considering the Bridging Solution
Bridging is a process where you use an intermediary application to translate requests between .NET and Java. The Java application doesn't actually know that your .NET application is making a request because the intermediary performs the work of changing the request into something Java can understand. You'll use bridging where you have a large Java investment and need to preserve it for other purposes.
JNBridge requires a very simple setup as part of the solution. It works very much like a COM proxy, but with greater flexibility. Double click the JNBProxy v3.1 (.NET 2.0-targeted) icon on your Desktop and you'll see the dialog box shown in Figure 1 where you can choose proxy settings.
 | |
| Figure 1. Set the proxy settings for JNBridge to begin creating your connectivity solution. |
As you can see, JNBridge provides three completely different methods of providing proxy services. Use the Shared Memory option for interoperability on a single machine. It's very fast and lets you test a setup locally before you move it to a network or other location. The Binary/TCP solution works great on a network. It provides relatively high speed and some security. Finally, the SOAP/HTTP solution lets you connect even across the Internet. You can use it in situations where you have to connect through firewalls. The main attraction of the JNBridge solution is flexibility; you can connect to almost anything, anywhere. The demonstrations that come with the product tell you how to create a number of application types and how to use the product to best advantage. JNBridge allows interoperability between .NET and both POJOs (Plain Old Java Objects) and J2EE application servers, and has been tested on a wide variety of application servers including:
Borland Enterprise Server
JBoss-Tomcat
JRun
Oracle AS
Sun ONE App Server
Sybase EAServer
BEA WebLogic
IBM WebSphere
Considering Code Conversion
JLCA actually converts Java code into .NET code. This particular product comes with Visual Studio, so you already have it installed. To access the standard version of JLCA, choose File | Open | Convert in Visual Studio. When you see the Convert dialog box, choose Java Language Conversion Assistant 3.0 and click OK. At this point, you see the Java Language Conversion Assistant Wizard. Follow the prompts to convert your application.
You can find a complete step-by-step example of using JLCA on MSDN. Microsoft answers common questions about the version of JLCA that comes with Visual Studio here. The basic premise is that the application looks at the Java source and performs the mapping required to .NET calls. Of course, Java doesn't always provide calls that map directly to .NET code and you might have custom libraries that use special calls. In this case, you may need the JLCA Companion product that provides more mapping capabilities than the version provided with Visual Studio. In addition to providing better mapping features, JLCA Companion also provides:
Better support for Java third-party libraries
Behavior personalization to make it easier to convert applications later
Getting to the NXT Step
This article has only touched on some of the solutions that Microsoft provides to help you move from Java to .NET. You can learn more about the Microsoft NXT initiative, which helps you provide a comprehensive end-to-end solution for your cross-platform needs.
* This article was commissioned by and prepared for Microsoft Corporation. This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.