Yes, you will need to implement the Java interface with Ruby first. Then, once you have that working, you can convert your Java class (which is implemented in Ruby) into a proxy that wraps a plain old Ruby object. This is generally what I do. Does that make sense?
So, after you create your plugin with the 'jpi' tool. make a file called "my_trigger.rb" in the models/ directory. It might look something like this:
<Ruby>
class MyTrigger < Java.hudson.triggers.Trigger
def start(job)
#code to do stuff here
end
end
#now we need to explicitly register this, since it's not yet an "official" proxy interface, and it won't happen automatically
Jenkins::Plugin.instance.register_describable MyTrigger, Java.hudson.triggers.Trigger
</Ruby>
And you should be good to go. Keep in mind that this class is implementing a Java interface, and as such it receives Java objects in its methods, and must return Java objects that conform to the interface.
Can somebody from the Java part of the Jenkins community tell me if this will actually work? I noticed that the hudson.triggers.Trigger class is parameterized by Item... Does this class factor into when the trigger is invoked?