osgi-服务的多个实例 [英] osgi - multiple instances of a service

查看:104
本文介绍了osgi-服务的多个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建使用外部Web服务的捆绑包的多个实例? 外部Web服务要求客户​​端在使用服务之前登录.我有多个帐户.问题是我希望能够添加多个实例.每个帐户一个.每个实例都是使用外部服务的osgi声明式服务.

How can I create multiple instances of a bundle that consumes an external webservice? An external webservice requires clients to logon before using the services. I have multiple accounts. The problem is I want to be able to add multiple instances; one for each account. Each instance is an osgi declarative service that consumes the external service.

我必须为每个帐户部署一个新的捆绑软件吗?这似乎不是解决此问题的正确方法.

Do I have to deploy a new bundle for each account? This does not feel like the right way to solve this.

推荐答案

该捆绑包是否在您的控制之下-您可以对其进行重构吗?

Is that bundle under your control - can you refactor it ?

如果是,则公开客户端工厂服务而不是客户端服务本身可能很有用. 然后,每个实例都可以登录到不同的帐户.

If yes, it might be useful to expose a client factory service, rather than client service itself. Then each instance can log into a different account.

这篇关于osgi-服务的多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆