MS java/com Integration

Source: Internet
Author: User

Microsoft Java compilers, virtual machines, and a wide variety of tools greatly simplify the work of java/com programmers compared to c++/com programmers. The compiler has special boot commands and packages that can treat Java classes as COM classes. In most cases, however, we simply rely on the support provided by the Microsoft JVM for COM while leveraging two powerful external tools.
The Microsoft Java Virtual Machine (JVM) plays a role as a bridge between COM and Java objects. If you create a Java object as a COM server, our objects will still be running inside the JVM. The Microsoft JVM is implemented as a DLL, and it shows the COM interface to the operating system. Internally, the JVM maps a function call to these COM interfaces to a method call in a Java object. Of course, the JVM must know which Java class file corresponds to the server execution module, and it is because we have previously registered the class file with JavaReg in the Windows registry. JavaReg is a tool that is provided with the Microsoft Java SDK to read a Java class file, generate a corresponding type library and a GUID, and register the class into the system. You can also register a remote server with JavaReg. For example, it can be used to register a server running on a different machine.
If you want to write a java/com customer, you have to go through a series of different steps. Java/com "Customers" are special Java code that wants to activate and use a COM server registered within the system. Similarly, a virtual opportunity communicates with a COM server and exposes the services it provides as a variety of methods within the Java class. Another Microsoft tool is JActiveX, which reads a type library and generates the corresponding Java source file, which contains special compiler boot commands. The generated source file belongs to a part of the package that we named after the specified type library. The next step is to import the package in your own COM client java source file.
Let's now discuss two examples.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.