JBTM-669 has a draft implementation you can look at.
JBTM-2480 Provide documentation of how to integrate with Karaf