J-Integra® Espresso offers an easy and high performance solution to establish interoperability between .NET and Java. You can access EJB or Java objects implementing RMI remote interfaces. It is also possible to use and exchange Java serializable objects, catch exceptions thrown in Java, or throw exceptions in .NET. If you have a running Java system all this can be done without any changes on the Java side. Many Java types are directly mapped to .NET types (e.g. java.util.Hashtable is mapped to System.Collections.Hashtable).
The mapping is performed in two steps. During the first step Java is mapped to IDL (Interface Definition Language) and during the secound step IDL is mapped to .NET. IDL is a specification published by the Object Management Group (OMG). In the examples listed below we show how the mappings between .NET and Java work with a focus on the Java language types.
In all of the following examples we use Java as the server language and .NET as the client language. The Java server is written as an RMI server. The mappings are the same no matter which environment you are using (RMI on a Java server or EJBs on a J2EE server).
| Java | OMG IDL | .NET |
| void | void | void |
| boolean | boolean | bool |
| char | wchar | char |
| byte | octet | byte |
| short | short | short |
| int | long | int |
| long | long long | long |
| float | float | float |
| double | double | double |
| string | WStringValue | string |
| Java | .NET |
| java.rmi.Remote | Ics.CORBA.Object |
| java.io.Serializable | Ics.CORBA.Any |
| java.net.URI | System.Uri |
| java.net.URL | Ics.java.net.URL |
| java.sql.Date | Ics.java.sql.Date |
| java.sql.Time | Ics.java.sql.Time |
| java.sql.TimeStamp | Ics.java.sql.TimeStamp |
| java.util.ArrayList | System.Collections.ArrayList |
| java.util.Calender | Ics.java.util.Calender |
| java.util.GregorianCalender | Ics.java.util.GregorianCalender |
| java.util.Date | System.DateTime |
| java.util.Hashtable | System.Collections.Hashtable |
| java.util.HashMap | Ics.java.util.HashMap |
| java.util.HashSet | Ics.java.util.HashSet |
| java.util.IdentityHashMap | Ics.java.util.IdentityHashMap |
| java.util.LinkedHashMap | Ics.java.util.LinkedHashMap |
| java.util.LinkedHashSet | Ics.java.util.LinkedHashSet |
| java.util.LinkedList | Ics.java.util.LinkedList |
| java.util.Locale | System.Globalization.CultureInfo |
| java.util.Properties | Ics.java.util.Properties |
| java.util.Random | Ics.java.util.Random |
| java.util.SimpleTimeZone | Ics.java.util.SimpleTimeZone |
| java.util.Stack | Ics.java.util.Stack |
| java.util.TreeMap | Ics.java.util.TreeMap |
| java.util.TreeSet | Ics.java.util.TreeSet |
| java.util.Vector | Ics.java.util.Vector |