获取父bean工厂中的bean后处理器来处理子工厂中的bean
我有一个父 bean 工厂,我希望其中有一个 BeanPostProcessor 来对子工厂中的 bean 进行后处理。 AFAIK,Spring 不支持此功能。我有什么选择? (当然,在每个子工厂的 XML 中声明后处理器除外)
I have a parent bean factory and I'd like a BeanPostProcessor in it to post process beans in child factories. AFAIK, this isn't supported in Spring. What are my alternatives? (except of course to declare the post processor in the XML of each child factory)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种“解决方案”是将 bean 后处理器添加到执行父后处理器的子上下文中。这是我们最终使用的技术。在我看来,这有潜在的危险,而且不是最好的 Spring 实践。
One "solution" is to add a bean post processor to the child context that executes the parent post processors. This is the technique we ended up using. It is potentially dangerous and not the best Spring practice IMO.