I'm Migrating Apache Felix SCR Annotations to OSGI Declarative Services[AEM]. While Migration I cant find exact replacement for cardinality in DS .
Existing SCR Implementation :
@Component (ds = true, immediate = true, metatype = false, policy = ConfigurationPolicy.OPTIONAL)
@Service (SampleService.class)
public class SampleServiceImpl implements SampleService
{
private static final int VECTOR = Integer.MIN_VALUE + 1;
@Property (value = REPOSTING_PATTERN, cardinality = VECTOR,description = "Event reposting pattern for QueuePosting ")
private static String EVENT_REPOSTING_PATTERN = "eventRepostingPattern";
}
Now it is migrated as Below in OSGi Declarative services
@Component (configurationPolicy = ConfigurationPolicy.OPTIONAL, immediate = true, service =SampleService.class,
property = {SampleServiceImpl .EVENT_REPOSTING_PATTERN +"="+SampleServiceImpl .EVENT_REPOSTING_PATTERN_VALUE })
public class SampleServiceImpl implements SampleService
{
private static String EVENT_REPOSTING_PATTERN = "eventRepostingPattern";
private static String EVENT_REPOSTING_PATTERN = "eventRepostingPatternValue";
}
In DS annotation Implementation How I have to map the parameter cardinality which is present in @Property.Kindly suggest me