3

I need to pull some data from Java into C#. I am already exposing my C# classes via COM. So I thought a good way to pull data from Java would be to expose IReadStream from C# and implement IReadStream in Java. I can then send an instance of the implementation as a parameter to C# so that I can call IReadStream.Read in C#.

How do I implement a custom COM interface in Java?

1
  • You may have to use JNI/JNA to expose a C++ COM interface that your C# class can use. Commented Mar 30, 2009 at 8:57

3 Answers 3

0

I don't know if it supports this direction, but Jacob is a Java COM Bridge that's frequently mentioned.

Also, using IKVM to run the Java code might make the task significantly easier.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, i know about jacob. don't think it support what i want to do
0

Using COM sounds overly messy whats wrong with exposing your c# code via a socket and have java suck that down.

Comments

0

I went for named pipes in the end.

On the java side I write into a named pipe (served from the c# side). In c# i should now be able to read from the named pipe. As long as the Read operation is blocking it should be the same as pulling data from java.

See http://www.codeproject.com/KB/threads/dotnetnamedpipespart1.aspx for a c# wrapper around the Named pipes api calls.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.