OSGi 将对象绑定到 Glassfish 中的 JNDI

发布于 2024-09-12 14:30:50 字数 256 浏览 2 评论 0原文

OSGi 和 Glassfish 的新功能。我编写了一个 OSGi 包,它创建了一个不可序列化的管理器对象,我想通过 JNDI 公开该对象,以便我的 Web 应用程序可以利用它。 (以前在 JBoss 中,我使用 org.jboss.naming.NonSerializedFactory 来执行此操作,但我似乎找不到任何与 Glassfish 类似的方法。)

假设这不能用 GF 完成,是否有其他方法可以访问它从我的 Web 应用程序中绑定到 BundleContext 的对象?

New to OSGi and Glassfish. I have an OSGi bundle written that creates a non-serializable manager object that I would like to expose via JNDI so that my web applications can utilize it. (Previously with JBoss I utilized org.jboss.naming.NonSerializableFactory to do this, but I can't seem to find any analogous approach with Glassfish.)

Assuming this can't be done with GF, is there some other way to access this object that is bound in the BundleContext from within my web application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

层林尽染 2024-09-19 14:30:50

您可以将 Web 应用程序部署为捆绑包,然后将“不可序列化管理器对象”作为 OSGi 服务进行访问。您可以更改 Web 应用程序以制作捆绑包,也可以使用以下命令将其即时转换为捆绑包:
开始玻璃鱼
远程登录本地主机 6666

安装 webbundle:文件:/tmp/foo.war?Web-ContextPath=/foo
开始

我不看这个论坛,我看 glassfish 论坛 - 如果您愿意,您可以在那里提问。

You can deploy your web application as a bundle and there by access the "non-serializable manager object" as an OSGi service. You can either change the web app to make a bundle or you can convert it into a bundle on the fly using the following commands:
start glassfish
telnet localhost 6666

install webbundle:file:/tmp/foo.war?Web-ContextPath=/foo
start

I don't watch this forum, I watch glassfish forum - you can ask there if you wish.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文