CallbackFactory deprecated; what is a contemporary example?

Hello Jruby Folks,

So I am trying to implement some Jruby extensions using the
BasicLibraryService class based on this blog entry

I’m using jruby-1.7.4 and it seem that the callbackFactory method on
Ruby object is now setup to throw an exception because the that
technique is deprecated.

The documentation talks about using MethodFactories now, instead of the
CallbackFactory. However I could not glean from the documentation how
this was supposed to work.

The code that does not work looks like below

public boolean basicLoad(final Ruby runtime) throws IOException {
RubyModule string = runtime.getModule(“String”);
CallbackFactory fact =
runtime.callbackFactory(FastXsService.class);
string.defineMethod(“fast_xs”,fact.getFastSingletonMethod(“fast_xs”
));
return true;
}

What’s the contemporary equivalent using MethodFactory? Where do I get
a MethodFactory instantiated with everything I need?

Thanks in advance for any help!

Chris Kruger