I overview after these examples to ease the pain
@@connection = Java::Connect(usr,pass)
This works:
@@connection.getForeignListing.getListing(1441).getStreet #=> 123
Candy Ln.
This works:
@@connection.send(âgetForeignListingâ).send(âgetListingâ,
1441).send(âgetStreetâ) #=> 123 Candy Ln.
This works:
def test(a,b,c,d)
return @@connection.send(a).send(b,c).send(d)
end
test(âgetForeignListingâ, âgetListingâ, 1441, âgetStreetâ)
Does not work:
def test(a,b,c)
return @@connection.send(a).send(b).send©
end
test(âgetForeignListingâ, [âgetListingâ, 1441], âgetStreetâ)
test.rb:4:in `sendâ: [âgetListingâ, 5053500] is not a symbol (TypeError)
In summary, Iâve managed to hook the working versions above within a
class for a DRb server.
The ultimate goal, is to create a generic DRb method that client input
into into method-syntax that the connection can interpret.
For example, as mentioned above, this works:
@@connection.getForeignListing.getListing(1441).getStreet
Iâd like to create a method in the DRb server that could accept
something like:
java_call = âgetForeignListing.getListing(1441).getStreetâ
@@connection.send(java_call)
This would allow me to dynamically manage the java methods via DRb.
Thanks so much for your input.