gpt4 book ai didi

java - 将多个服务注册到 WSO2 Identity Server 中的单个接口(interface)

转载 作者:太空宇宙 更新时间:2023-11-04 09:59:16 25 4
gpt4 key购买 nike

我正在尝试找到一种方法将多个实现注册到 OSGI 框架内的单个接口(interface)。目前我有一个 UserStoreManager 接口(interface)的实现,我在下面的代码中将其注册到 OSGI 框架中。

protected void activate(ComponentContext ctxt) {
Hashtable<String, String> props = new Hashtable<String, String>();
CustomUserStoreManager customUserStoreManager = new CustomUserStoreManager();
ctxt.getBundleContext().registerService(UserStoreManager.class.getName(), customUserStoreManager, props);
}

问题是已经有另一个 UserStoreManager 接口(interface)的实现,我无法删除它。

如何以不会导致其他实现出现问题的方式注册我的实现?

我读到了有关提供属性以及如何使用它来解决此问题的信息,但是我不相信 WSO2 的身份服务器会拾取我提供的属性。

UserStoreManager 接口(interface)的两种实现都用作身份服务器内的辅助用户存储。

谢谢。

最佳答案

无需删除现有的 UserStoreManager 实现。如果要将新的自定义 UserStoreManager 用于主用户存储,请替换 user-mgt.xml 文件中的 UserStoreManager 类并重新启动服务器。然后就会使用这个com.custom.user.manager.CustomCUserStoreManager。

<UserStoreManager class="com.custom.user.manager.CustomUserStoreManager">

如果您想更改辅助用户存储,请在管理控制台的编辑辅助用户存储中更改类名称。

关于java - 将多个服务注册到 WSO2 Identity Server 中的单个接口(interface),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53705249/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com