如何在声明式服务的组件定义中设置不同的ECF分发提供者?

发布于 2024-12-22 01:20:27 字数 1192 浏览 0 评论 0原文

我必须测试 ECF 中存在的所有远程服务提供程序(或者至少是常见的:通用、r-osgi、SOAP 和 REST)的性能,因此以一种简单的方式从一个提供程序更改为另一个提供程序将会有很大帮助。

我知道如何在 component.xml 文件中设置某些提供程序的端点描述,例如,对于 Generic 是:

<property name="service.exported.interfaces" type="String" value="*"/>
<property name="service.exported.configs" type="String" value="ecf.generic.server"/>
<property name="ecf.exported.containerfactoryargs" type="String" value="ecftcp://localhost:3787/server"/>

将“service.exported.configs”修改为其他名称,例如“ecf.r_osgi.peer”将更改提供程序没有问题,并且无需重新编译代码。

此外,“containerfactoryargs”属性也存在一些差异(例如,在前面的示例中将 ecftcp:// 更改为 r-osgi://。但是,在提供程序列表 我没有看到有关其他提供程序中这种差异的示例(我将如何使用 SOAP,例如示例有哪些服务属性?提供者?)

此外,使用 Restlet(例如)意味着修改服务的源代码以添加 @Get("text") 注释 如此处所述。那么,您是否有义务在服务代码中添加注释以将它们公开为 Restful 或 SOAP 服务?我想不是在我的服务中添加“侵入性”代码,或尽可能避免从其他方法(例如 ConfigurationLoader)激活它们。

因此,有任何信息页面包含所有(或至少是最常见的)组件定义文件的示例。分销商?或者,哪种是在不重新编译源代码的情况下更改提供程序的最优雅的方法?也许,如前所述,使用 ConfigurationLoader 服务来更改属性?

提前致谢!

I have to test the performance of all the remote service providers present in ECF (or at least, the common ones: generic, r-osgi, SOAP and REST), so changing from one provider to another in an easy way would help a lot.

I know how to set the Endpoint Description of some providers in the component.xml file, for example, for Generic is:

<property name="service.exported.interfaces" type="String" value="*"/>
<property name="service.exported.configs" type="String" value="ecf.generic.server"/>
<property name="ecf.exported.containerfactoryargs" type="String" value="ecftcp://localhost:3787/server"/>

Modifying the "service.exported.configs" to other names, like "ecf.r_osgi.peer" would change the provider without problem, and without re-compiling the code.

Also, there are some differences in the "containerfactoryargs" property (for example, changing ecftcp:// to r-osgi:// in the previous example. However, in the providers list I don't see examples about this differences in other providers (how I would use SOAP, for example? Which are the service properties for this provider?)

Moreover, using Restlet (for example) implies modify the source code of the service to add the @Get("text") annotation as explained here. Then, are you obligated to add annotations in your service's code to expose them as Restful or SOAP services? I would like to not add "intrusive" code in my services, or avoid their activation from another method (such as ConfigurationLoader) as far as possible.

So, there are any information page with examples of component definition files for all (or at least, the most common) distribution providers? Or, which is the most elegant way to change the provider without re-compiling source? Maybe, as stated before, using the ConfigurationLoader service to change the properties?

Thanks in advance!

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

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

发布评论

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