我正在从Apache注释迁移到OSGI声明性服务,这是我的问题。
在我有: SCR注释实现之前
@Component (ds = true, immediate = true, metatype = false, policy = ConfigurationPolicy.OPTIONAL)
@Service (SampleService.class)
public class SampleServiceImpl implements SampleService
{
..
..
}现在我有了: DS注释实现。
@Component (configurationPolicy = ConfigurationPolicy.OPTIONAL, immediate = true, service = SampleService.class)
public class SampleServiceImpl implements SampleService
{
..
..
}在DS注释实现中,如何映射、ds、和元类型参数?
否则忽略ds和元类型参数是好的吗?
发布于 2021-04-20 09:15:56
无论如何,ds=true和metatype=false都是默认的。在你的情况下,你可以安全地忽略它们。
https://stackoverflow.com/questions/67175132
复制相似问题