JX
for .NET 2.0 – Technology preview
Introduction
This technology
preview of JX for .NET (JX) is intended to demonstrate how
simply and transparently JX enables to integrate .NET and
Java technologies.
A key differentiator between JX and other solutions on the
market, is the fine level of integration that JX offers to
interoperate with Java.
With JX, .NET and Java run side by side within the same
process which is different from Web services or CORBA
technologies that operate at the inter-process level.
JX enables interoperability at the intra-process level.
Consequently, JX supports advanced integration scenarios that
leverage Java technology investments and significanlty reduce
integration costs.
Most importantly, JX guarantee out of the box Java enterprise
quality of service (QoS) when accessing Enterprise Java Beans
(EJB) or the Java Message Service (JMS), a feature which is
instrumental in enterprise computing environments and
extremely difficult to achieve, if not even impossible, with
other interoperability alternatives.
JX also offers excellent performances that are similar as in
a native Java to Java interoperability scenario.
How does JX
work
With JX, they are
only 3 steps to access Java from .NET.
Step 1 - Select
In JX
code generator (JX Generator) select any Java class you want
to access from .NET.
JX Generator automatically displays the list of available
Java classes including your Java classes.

Step 2 -
Generate
Using JX Generator, generate .NET proxy classes corresponding
to the selected Java classes.
JX generated .NET classes match the original Java classes
constructor by constructor, method by method and field by
field. There might be minor differences due to programming
language capabilities, but in general the .NET and Java are
the same.
Step 3 -
Access
You are now ready to access Java from .NET.
You can invoke any Java class constructor, method or field
from .NET.
JX
Demo
In this demo, a .NET
2.0 client, written in C# and using JX generated proxy
classes, displays the Java system properties in a WinForm.
The resulting output is shown below.
Figure 1
“JX for .NET” showing Java system properties from
.NET 2.0 C# client
Here we have
.NET code that, using JX generated classes, access several
Java classes - java.lang.System, java.util.Properties,
java.util.Enumeration, java.lang.String and java.lang.Object.
Below are two code extracts. One is written in .NET 2.0 C#
the other one in Java 5.0. Can you tell the difference?
Source code
extract 1:
java.util.Properties properties = java.lang.System.getProperties();
java.util.Enumeration propertyNames = properties.propertyNames();
while (propertyNames.hasMoreElements()) {
String propertyName = (String)propertyNames.nextElement();
String propertyValue = java.lang.System.getProperty(propertyName);
… // Output property name, value.
}
Source code
extract 2:
java.util.Properties properties = java.lang.System.getProperties();
java.util.Enumeration propertyNames = properties.propertyNames();
while (propertyNames.hasMoreElements()) {
String propertyName = (String)propertyNames.nextElement();
String propertyValue = java.lang.System.getProperty(propertyName);
… // Output property name, value.
}
As you can see, both source codes look the same,
demonstrating JX transparent interoperability capabilities.
But actually, the source code extract 1 is written in .NET
2.0 C# and the
source code extract 2 is written in Java 5.0.
Worth mentioning is the sophisticated level of integration
visible in the cast operation. The
propertyNames.nextElement() method returns a java.lang.Object
but needs to be cast as a .NET String in this context.
Conclusion
Through this
technology preview of JX for .NET, we have seen how JX can
transparently and cost efficiently integrate .NET with Java.
JX leverage Java technology investments and allows advanced
integration scenarios to access Java either locally or
remotely - Enterprise Java Beans (EJB), Java Message Service
(JMS) - while also guaranteeing Java enterprise quality of
service (QoS).
Download JX for
.NET technology preview
Download JX for .NET Technology
Preview today and see for yourself how
easily .NET and Java can run side by side.
Requirements
Visual Studio
2005 (.NET 2.0).
Java Runtime Environment (JRE) 1.3 and above
Freely available at http://java.sun.com/javase/downloads/index.jsp.
Support
Free support is
available for any questions or issues you might have with JX
for .NET Technology Preview by contacting J4SOFT at
support@j4soft.com.
What's
next
If you are interested
in having access to early releases of JX for .NET contact
send us an email at info@j4soft.com
with the subject "JX
for .NET - early releases access request".