我试图找到一种方法来将多个实现注册到OSGI框架内的单个接口 . 目前我有一个UserStoreManager接口的实现,我在下面的代码中在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接口的实现,我不能简单地删除它 .
如何以不会导致其他实现出现问题的方式注册我的实现?
我读到了提供属性以及如何使用它来解决这个问题,但我不相信我提供的属性是由WSO2的Identity Server提取的 .
谢谢 .
1 回答
无需删除现有的UserStoreManager实现 . 如果要将新的自定义UserStoreManager用于主用户存储,请替换user-mgt.xml文件中的UserStoreManager类并重新启动服务器 . 然后将使用此com.custom.user.manager.CustomCUserStoreManager .
如果要为辅助用户存储更改它,请在管理控制台中更改编辑辅助用户存储中的类名 .