In the reference implementation of the JAX-RS Whiteboard for OSGi, what calls createWhiteboard(..)?

225 Views Asked by At

The reference implementation of OSGi's JAX-RS Whiteboard is called Aries JAX-RS Whiteboard.

My question is, how and when does the factory method for the Whiteboard.class get called?

public static Whiteboard createWhiteboard(
    Dictionary<String, ?> configuration) {

    return new Whiteboard(configuration);
}

Like, for example, if I drop the jar into an Apache Felix instance?

I searched the whole project for the createWhiteboard symbol, but I did not find anything calling it. I know it is OSGi Runtime that does this, but how, where?

1

There are 1 best solutions below

0
On BEST ANSWER

Ok, so I answered my own question.

The Whiteboard.class is called by a separate "activator" class that implements the standardized OSGi callback interface, BundleActivator: CxfJaxrsBundleActivator at line 76. This is analogous to the entry point of a program. Then, at line 105, the runWhiteboard method is called, which abstracts away the call to createWhiteboard use a method that is perhaps way more complicated than it should be starting at line 198.

The main calls in the stack in bottom-up order would be:

createWhiteboard(configuration)
runWhiteboard(bundleContext, configuration)
start(BundleContext bundleContext) throws Exception