Reputation: 2523
I want to develop a Java-Application that exposes it's functionality through COM, as a legacy VB application needs to communicate with it.
There are several libraries that can consume COM components; but do some of them at the same time support exposing COM?
I also thought of creating a proxy written in C#, which then communicates with the Java-App through protobuf.
Any ideas?
Upvotes: 1
Views: 540
Reputation: 8942
Java on Windows Platforms comes bundled with an ActiveX packager. Using this packager, you can publish your JavaBeans as a COM object. Alas, the packager is intended for Visual JavaBeans (i.e. UI components exposed as widgets), I am not sure how well it deals with non-visual components.
Upvotes: 2
Reputation: 28981
You always could do it via JNI with C/C++. Just run the JVM from it.
Yet another option - you could use pure C to create a .dll and call it directly from VB. Here you could do it via JNI or use GCJ to build native library from java code.
Or you could expose the java app as a WebService or similar.
Upvotes: 1
Reputation: 2265
If this is a standalone app or server process even with protobuf you are going to need a way to communicate with the Java code. Have you thought about writing the Java necessary to expose an HTTP endpoint? You could expose an API that way and have the VB access the Java directly rather than going through a proxy. This I have done.
If the Java is just a library I would suggest looking to Managed C++. You could make JNI calls into the Java. You could create the COM object in C++ and then use JNI to map into Java for the actually work. This I have not done...but you asked for ideas!
Upvotes: 1