如何观察(或拦截)CDI 中开始的对话?

发布于 2024-12-19 03:40:29 字数 593 浏览 2 评论 0原文

我想观察或拦截 CDI 中的 Conversation.begin() 方法调用,以便存储新的 Conversation.getId() 并列出所有打开的对话。

我在规范(JSR-299)中找不到如何观察这样的事件。我正在考虑 扩展 的复杂系统,它可能会使用 < a href="http://docs.jboss.org/cdi/spec/1.0/html_single/#pit" rel="nofollow">ProcessInjectionTargetProcessProducer 或其他事件来执行此操作...但我觉得还有另一个更简单的解决方案...

I would like to observe or intercept Conversation.begin() method call in CDI in order to stock the new Conversation.getId() and list all the opened conversation.

I don't find in the spec (JSR-299) how to observe such event. I'm thinking of complex system of Extension which would perhaps use ProcessInjectionTarget or ProcessProducer or other events to do that... but I feel like it exists another simpler solution...

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

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

发布评论

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

评论(1

眼趣 2024-12-26 03:40:29

嗯,这些是内置的 beans,因此无法装饰。在 CDI 1.1 中,您可以使用 ProcessInjectionPoint,或向 issues.jboss.org/browse/CDI 添加请求,以便能够装饰内置 bean。

所以现在,没什么想法,抱歉。

Hmm, these are built in beans and so can't be decorated. In CDI 1.1 you could use ProcessInjectionPoint, or add a request to issues.jboss.org/browse/CDI to be able to decorate built in beans.

So right now, not much idea, sorry.

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