I need to transfer some data from Java to C #. I already show my C # classes through COM. So I thought that a good way to pull data from Java would be to set the IReadStream from C # and implement IReadStream in Java. I can then send the implementation instance as a parameter in C # so that I can call IReadStream.Read in C #.
IReadStream
IReadStream.Read
How to implement native COM interface in Java?
In the end, I went to named pipes.
On the java side, I write to a named pipe (served from C #). In C #, I should now be able to read from a named pipe. While the read operation is blocked, it should be the same as pulling data from java.
See http://www.codeproject.com/KB/threads/dotnetnamedpipespart1.aspx for a C # wrapper around named API calls.
I donβt know if this supports this direction, but Jacob is often called Java COM bridge.
In addition, using IKVM to run Java code can greatly simplify the task.
Using COM sounds is excessively dirty, which is not the case if you expose your C # code through a socket and have java suck that down.