The wiki page: Scripting Java from JRuby (jruby 1.0+) contains excellent advice and ideas that you may leverage to get your wrapper
I think interesting the use of the Module name to scope access to the imported Java class
For Example: create a Ruby Module called JavaLangDemo that includes the classes in the Java package java.lang.
module JavaLangDemo
include_package "java.lang"
# alternately, use the #import method
import "java.lang"
end
Now you can prefix the desired Java Class name with JavaLangDemo:: to access the included Classes:
version = JavaLangDemo::System.getProperties["java.runtime.version"]
=> "1.5.0_13-b05-237"
processors = JavaLangDemo::Runtime.getRuntime.availableProcessors
=> 2
The article also explains the following topics:
- implementing a Java interface in Ruby
- class name ambiguity between Java and Ruby
- "mixing-in" more than one Java interface to a Jruby modules in JRuby
- Exception Handling
- Synchronization of objects for thread safety
and includes a list of usefull links to "Related Articles" for further information about
Java integration layer