1

OSGi 的 JAX-RS 白板的参考实现称为Aries JAX-RS 白板

我的问题是,如何以及何时Whiteboard.class调用 get 的工厂方法?

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

    return new Whiteboard(configuration);
}

例如,如果我将 jar 放入 Apache Felix 实例中?

我在整个项目中搜索了该createWhiteboard符号,但没有找到任何调用它的东西。我知道是 OSGi Runtime 做到了这一点,但是如何,在哪里?

4

1 回答 1

0

好的,所以我回答了我自己的问题。

由实现标准化 OSGi 回调接口的Whiteboard.class单独“激活器”类调用BundleActivatorCxfJaxrsBundleActivator第 76 行。这类似于程序的入口点。然后,在第 105 行,调用了该runWhiteboard方法,这将调用抽象为使用一个可能比从第 198 行createWhiteboard开始的方法要复杂得多的方法。

自下而上的堆栈中的主要调用将是:

createWhiteboard(configuration)
runWhiteboard(bundleContext, configuration)
start(BundleContext bundleContext) throws Exception
于 2020-09-24T07:00:36.593 回答