Java RMI -Remote Method Invocation- is Java to Java only.
On the Scala website I read that the integration with Java is seamless and that:
Scala programs run on the Java VM, are byte code compatible with Java so you can make full use of existing Java libraries or existing application code. You can call Scala from Java and you can call Java from Scala, the integration is seamless.
Does this mean that I can successfully use a Java to Scala RMI?
Did anyone experiment this first-hand?
EDIT:
Any known or discovered gotchas??
Scala is designed to work smoothly with Java and Java libraries like JMSL. This is clearly evident in how Scala picks up the same CLASSPATH environment variable Java uses, so if the Java library you wish to use is already there in the CLASSPATH, then you're good to go.
Yes, here's a link to a message thread where it looks like somebody's done it. It says:
Yes it can! Thanks for help. I now have a little RMI-based pair of Scala programs that will be performing transfers of documents from one Documentum system to another (of a previous version); the Scala code is interacting very nicely with the Documentum Java libraries.
Figuring out how to get the method signatures to include throws RemoteException
seems to have been the biggest hurdle.
Yes, this can be done. The rmi compiler works with java byte code, so the language used really doesn't matter. I've done this for a class project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With