简体   繁体   English

如何使EAR文件相互通信?

[英]How to make EAR files communicate with each other?

I'm tying to create a system that allows EAR applications to register into another EAR application to receive certain Web Services requests. 我要创建一个允许EAR应用程序注册到另一个EAR应用程序以接收某些Web服务请求的系统。 Lets call this the Main EAR and the Plugin EAR . 让我们将其称为Main EARPlugin EAR

The logic for this would be: 这样做的逻辑是:

1 - Main EAR starts 1- 主EAR启动

2 - Plugin EAR starts 2- 插件EAR启动

3 - Plugin EAR sends it's configuration to Main EAR (with it's allowed request types) 3- 插件EAR将其配置发送到Main EAR (及其允许的请求类型)

4 - External application sends a request to Main EAR 4-外部应用程序向Main EAR发送请求

5 - Main EAR checks to see if it's able to handle the request and if not, sends it to Plugin EAR (if it's on the allowed request type list) 5- Main EAR检查是否能够处理请求,如果不能,则将其发送给Plugin EAR (如果在允许的请求类型列表中)

6 - Plugin EAR handles the request and responds to Main EAR 6- 插件EAR处理请求并响应Main EAR

7 - Main EAR responds to the External application with the information handled by Plugin EAR 7- Main EARPlugin EAR处理的信息响应外部应用程序

To implement this I created a WS on the Main EAR that receives (among other parameters) the requests that the Plugin EAR can handle, it's context root and the IP:port, but the problem is obtaining the Plugin EAR incoming port. 为了实现此目的,我在主EAR上创建了一个WS,该WS接收(除其他参数外) Pearin EAR可以处理的请求,上下文根和IP:port,但是问题是获取Plugin EAR传入端口。

Already tried the following solutions, but they are to server specific, and I need to be able to get this working on WebSphere and JBoss: 已经尝试了以下解决方案,但是它们是针对服务器的,我需要能够在WebSphere和JBoss上使它起作用:

Get the server port number from tomcat with out a request 在没有请求的情况下从tomcat获取服务器端口号

org.apache.catalina.ServerFactory.getServer() equivalent in Tomcat 7 Tomcat 7中的org.apache.catalina.ServerFactory.getServer()等效项

There would be an easy solution that was to add the port (since all the other parameters are easily obtainable) into a configuration file and then send it. 有一个简单的解决方案是将端口添加到配置文件中(因为所有其他参数都可轻松获得),然后将其发送。 But I'm trying to reduce to the maximum the number of configuration options. 但是我正在尝试将配置选项的数量减少到最大。

So I'm wondering if there's another way to make the EAR communicate with each other? 所以我想知道是否还有另一种方法可以使EAR彼此通信? Or is there any other way to discover the Plugin EAR incoming request port? 还是有其他方法可以发现Plugin EAR传入请求端口?

如何使用某些服务注册表(如UDDI)?

请注意我期望的解决方案,但是我通过服务器使用了特定的逻辑。

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

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