Java process isolation (for a COM object)
Posted on 2011-03-25
I have a Java program that uses an unstable/unreliable windows COM object--sometimes, the COM object causes the entire process to exit! I would like to isolate the COM object into another process and communicate to the COM object across the process, and if the COM process dies, the main app can report an error without mysteriously dying!
What are some ways of isolating a library (I call various functions from the COM library, for which I can write stubs), and calling it remotely. If two instances of my app run, each should have its own copy of the COM process, they should not interfere with each other.
The simplest thing I can think of is below, but I'm looking for other ideas out of the blue!
(I made the # points large so I can divide points between the various useful suggestions)
Simple idea: can create a process and us the process's stdin/stdout to communicate (or use network protocols). There may be a lot of work encoding/passing args back and forth.