OSGi的JAX-RS白板的参考实现称为Aries JAX-RS Whiteboard。
我的问题是,如何以及何时调用Whiteboard.class的工厂方法?
public static Whiteboard createWhiteboard(
Dictionary<String, ?> configuration) {
return new Whiteboard(configuration);
}例如,如果我将jar放入Apache Felix实例中?
我在整个项目中搜索createWhiteboard符号,但我没有找到任何调用它的东西。我知道是OSGi运行时做到了这一点,但是如何做到这一点,在哪里做到呢?
发布于 2020-09-24 15:00:37
好了,我回答了我自己的问题。
Whiteboard.class由一个单独的“激活器”类调用,该类实现标准化的OSGi回调接口BundleActivator:CxfJaxrsBundleActivator at line 76。这类似于程序的entry point。然后,在line 105调用runWhiteboard方法,该方法使用一个可能比在line 198开始时复杂得多的方法抽象出对createWhiteboard的调用。
堆栈中的主要调用以自下而上的顺序为:
createWhiteboard(configuration)
runWhiteboard(bundleContext, configuration)
start(BundleContext bundleContext) throws Exceptionhttps://stackoverflow.com/questions/64023816
复制相似问题