OSGi 和 Java 本机接口
我想开发可以调用Java Native接口的OSGi包。我有几个问题:
是否可以开发 OSGi 包并将 C 包装类和 JNI 放入其中?是否有我可以使用的已开发示例?
放置在 OSGi 包中的 java 方法是否可以调用放置在托管 bean 中的 java 方法?
祝愿
最美好的 还有一个问题:如何将一个简单的托管 bean 制作成 EJB?
I want to develop OSGi bundle which can call Java Native interface. I have a few questions:
Is it possible to develop OSGi bundle and place in it C wrapper classes and JNI? Is there already developed example which I can use?
Is it possible java methods placed in OSGi bundle to call java methods placed into managed bean?
Best wishes
P.S. One more question: How I can make one simple managed bean into EJB?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过在捆绑清单中包含
Bundle-NativeCode
标头,您可以相当轻松地完成此操作,并以跨平台的非常便携的方式进行。例如:
则将加载
或
这种方法的优点在于,您可以根据架构包含各种不同的本机库,并且 OSGi 运行时将自动为当前 platofmr 选择正确的设置例如,当您调用
System.loadLibrary("mylib1");
这是关于该主题的旧博客:http://robertvarttinen.blogspot.co.uk/2008/12/bundle-nativecode-in-osgi-manifest.html
You can do this fairly easily, and in a very portable way across platforms, by including the
Bundle-NativeCode
header in your bundle manifest.For example:
Will load
or
The beauty of this approach is that you can include various different native libraries based on the architecture, and the OSGi runtime will automatically select the correct set for the current platofmr when you, for example, call
System.loadLibrary("mylib1");
Here's an old blog on the topic: http://robertvarttinen.blogspot.co.uk/2008/12/bundle-nativecode-in-osgi-manifest.html