JRuby: Implement the event hook in plain Java