we are looking to integrate with Adobe LiveCycle Dataservices which is
basically a java application wrapped up in a WAR. Their application
ideally
will call java classes directly instead of through a REST service to
obtain
the data, is this possible to do when deploying JRuby/Rails app through
,
say Tomcat?
Hi AD,
jsr223 gives You ability to connect java world with ruby world inside
one JVM,
if that’s Your goal then yes.
In particular it is possible to run some ruby script and pass java
objects inside to it.
You could also have a class within the Rails world that implements some
known Java interface (perhaps an interface you’ve created). Then you can
pass that object back out to the Java side of the world and use it as a
service.
Paweł Wielgus wrote:
rubyEngine.getContext().setAttribute(“root”, root, ScriptContext.ENGINE_SCOPE);
2008/9/17 AD [email protected]:
basically a java application wrapped up in a WAR. Their application
Hi AD,
one solution would be to pass some proxy into ruby script and connect
from java to ruby through that proxy. In my case i was putting my java
object into ruby script so that ruby can operate on my java object.
When running jsr223 You can add java objects to ruby world by adding
attribute to jruby engine context like this:
ScriptEngineManager m = new ScriptEngineManager();
ScriptEngine rubyEngine = m.getEngineByName(“jruby”);
rubyEngine.setContext(new SimpleScriptContext());
rubyEngine.getContext().setAttribute(“root”, root,
ScriptContext.ENGINE_SCOPE);
where root might be Your proxy,
then in ruby $root is Your java object.