简体   繁体   English

从单独的JVM访问应用程序上下文和bean?

[英]Accessing application context and bean from separate JVM?

I'm working on an application that launches several batch files, which themselves launch JVMs using Spring application contexts. 我正在开发一个启动几个批处理文件的应用程序,这些文件本身使用Spring应用程序上下文启动JVM。 The application I'm working on needs to be able to access the beans being created from the application contexts in these JVMs so that I can manipulate them. 我正在处理的应用程序需要能够访问从这些JVM中的应用程序上下文创建的bean,以便我可以对其进行操作。

From my application, I do have access to the name of the context file and the bean name. 从我的应用程序中,我可以访问上下文文件的名称和Bean名称。 Is there a way I can access a reference to the beans created by these JVMs? 有什么方法可以访问对这些JVM创建的bean的引用?

You can expose your beans and use JMX connector from your client application to access it. 您可以公开bean并使用客户端应用程序中的JMX连接器来访问它。 Here's the documentation for Spring JMX. 这是Spring JMX的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM