如何观察(或拦截)CDI 中开始的对话?
我想观察或拦截 CDI 中的 Conversation.begin()
方法调用,以便存储新的 Conversation.getId()
并列出所有打开的对话。
我在规范(JSR-299)中找不到如何观察这样的事件。我正在考虑 扩展 的复杂系统,它可能会使用 < a href="http://docs.jboss.org/cdi/spec/1.0/html_single/#pit" rel="nofollow">ProcessInjectionTarget
或ProcessProducer
或其他事件来执行此操作...但我觉得还有另一个更简单的解决方案...
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,这些是内置的 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.