Spring Webflow 2 bean 定义的架构

发布于 2024-09-25 21:45:48 字数 295 浏览 4 评论 0原文

我有一个广泛使用 Spring Webflow 2 的项目。有超过 30 个流,每个流都有大量的 Bean。我注意到应用程序的启动时间在慢慢增加,并且在将日志级别设置为调试并运行日志后,看起来问题是流量数量不断增加。为了澄清一点,我的 Spring 应用程序中有几个常见的 applicationContext 文件,然后将特定于每个流的 bean 放置在它们自己的文件中,然后使用包含在更大的 applicationContext 中。元素。有没有更好的方法来构建我与 webflow 一起使用的 bean?此时启动时间已成为一个问题。

I have a project that uses Spring Webflow 2, extensively. There's well over 30 flows, each with a non-trivial number of beans. I've noticed that the application has been slowly gaining in startup time, and after setting the log level to debug and running through the logs, it looks like the problem is the increasing number of flows. To clarify a bit, I have several applicationContext files in my Spring app that are common, and then beans specific to each flow are placed in their own file, and then included in the larger applicationContext with an <import> element. Is there a better way to structure the beans I use with webflow ? It's at the point where the startup time is becoming an issue.

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

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

发布评论

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

评论(1

最好是你 2024-10-02 21:45:48

我使用的验证器设置使用一个中央注册表来存储基于 Hibernate 的验证器,并通过从我创建的每个 Webflow 流应用程序上下文中引用该中央注册表来创建 Spring 验证器。事实证明,父应用程序上下文查找花费了大部分时间。我将它们重构为都在 Spring Validator 接口下使用单个通用验证器,并将应用程序启动时间减少了一半。

I was using a validator setup that used one central registry for Hibernate-based validators, and created Spring validators by referencing that central registry from each webflow flow application context that I was creating. The parent application context lookups turned out to be what was taking the majority of the time. I refactored them to all use a single, common validator under the Spring Validator interface, and cut the application startup time in half.

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