Spring 3.1环境抽象和EJB集成

发布于 2024-12-18 15:59:07 字数 615 浏览 3 评论 0原文

我正在尝试在我们的 Java EE/EJB 应用程序中使用新的环境抽象。我们已经使用 SpringBeanAutowiringInterceptor 将 Spring Bean 注入到 EJB 中,方法是使用标准 beanRefContext.xml 引导 Java EE 应用程序的共享应用程序上下文。

现在,我编写了一个具体的环境类(源自 Spring 3.1 AbstractEnvironment),它使用某种环境“自动”检测来为运行应用程序的计算机选择正确的活动配置文件。借助此功能,我们的应用程序可以提供所有环境(耳内)的所有属性,并自动选择正确的属性集。

现在的问题是 org.springframework.beans.factory.access.SingletonBeanFactoryLocator.createDefinition(String, String) 使用 StandardEnvironment 类围绕 beanRefContext.xml 中的 beans/context 构建一个 bean 工厂组,并且我没有看到简单的配置方法此处使用的环境实现无需重写(覆盖)SingletonBeanFactoryLocator 的某些部分。

有没有一个简单的解决方案,或者是……计划支持通过 EJB/Java EE 集成指定环境实现吗?

I'm trying to use the new environment abstraction in our Java EE/EJB application. We're already using SpringBeanAutowiringInterceptor to inject Spring Beans into EJBs by using the standard beanRefContext.xml to bootstrap the shared application context for the Java EE app.

Now I've written a concrete Environment class (derived from Spring 3.1 AbstractEnvironment) which uses some kind of environment "auto" detection to select the correct active profile for the machine on which the app is running on. With this feature our app can be delivered with all properties for all environements (inside the ear) and auto select the correct property set.

The problem is now that org.springframework.beans.factory.access.SingletonBeanFactoryLocator.createDefinition(String, String) builds a bean factory group around the beans/context in beanRefContext.xml using the StandardEnvironment class, and I see no simple way to configure the environment implementation to use here without rewriting(overwriting) some part of SingletonBeanFactoryLocator.

Is there a simple solution for this, or is s.th. planned in the direction for supporting to specify the Environment implementation with the EJB/Java EE integration?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文