convert felix @properties & @property to OSGI annotations
Hi All,
Can someone help me to convert felix @properties & @property to OSGI annotations. If I have a single @property I can bring into OSGi @Component as an attribute. But In my case there are multiple @property which has been used inside @properties. Below is the sample code and request people to help me on the highlighted portion.
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Properties;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.PropertyUnbounded;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
@Component(metatype = true, immediate = true, label = "sample Hardware Importer Job")
@Service(value = {Runnable.class, sampleHardwareImporterJob.class})
@Properties(value = {
@Property(label = "Enabled", description = "Enable/Disable the Scheduled Service",
name = "service.enabled", boolValue = false),
@Property(label = "Allow concurrent executions",
description = "Allow concurrent executions of this Scheduled Service. Never set to true!",
name = Scheduler.PROPERTY_SCHEDULER_CONCURRENT, boolValue = false, propertyPrivate = true),
@Property(label = "Period", description = "Trigger the job every n seconds",
name = Scheduler.PROPERTY_SCHEDULER_PERIOD,
longValue = sampleHardwareImporterJob.ONE_DAY)})
public class sampleHardwareImporterJob implements Runnable {
@Property(value = {"en", "de", "fr", "it"}, unbounded = PropertyUnbounded.ARRAY)
public static final String LANGUAGES_PROPERTY = "sample.hardware.import.languages";
static final long ONE_DAY = 24L * 3600;
private static final Logger LOG = LoggerFactory.getLogger(sampleHardwareImporterJob.class);
private static final String[] defaultLanguages = {"en", "de", "fr", "it"};
private static final String DEFAULT_ROOT_PATH = "/content/";
private static final String sample_ROOT_PATH = "/content/sample";
private static final String DEFAULT_HARDWARE_PATH = "/content/hardware/";
private static final String DEFAULT_HARDWARE_FOLDER = "hardware";
private static final String HARDWARE_NODE_TYPE = "hardware";
private static final String XML_SOURCE = "https://sample-chsa-%s.providersaas.com/search.xml";
private static final String CQ_PAGE = "cq:Page";
@Property(value = XML_SOURCE)
private static final String XML_SOURCE_PROPERTY = "sample.hardware.import.xml";
private List<String> languages = new ArrayList<>();
Thanks,
Vijay