捆绑不可配置

Bundle is not Configurable

我正在创建一个带有调度程序的 OSGI 包。 安装后无法通过 CQ5/AEM.

中的系统控制台配置捆绑包

下面是我正在使用的注释。

@Component(immediate = true, metatype = false, label = "SiteMap manager Service")
@Service(value = Runnable.class)
@Properties({
    @Property(name = "scheduler.expression", value = "0 0/2 * * * ?"),
    @Property(name = "scheduler.concurrent", boolValue = false),
    @Property(name = "prop.enabled", boolValue = false),
    @Property(name = "inputPath", value = "changeme"),
    @Property(name = "outputPath", value = "changeme"),
    @Property(name = "username", value = "changeme"),
    @Property(name = "password", value = "changeme") })
public class SiteMapManager implements Runnable {
    private static final Logger LOGGER = LoggerFactory
            .getLogger(SiteMapManager.class);

    private String inboundDirectory;
    private String extractionDirectory;
    private String failDirectory;
    private String username;
    private String password;
    private Boolean enabled;

    private static AtomicBoolean runningInstances = new AtomicBoolean(false);

    @Reference
    private SlingRepository repository;

    @Reference
    ResourceResolverFactory factory;

    @Reference
    private Replicator replicator;
    protected void activate(ComponentContext componentContext) {
        LOGGER.debug("Start Article Ingestor Configuration");
        configure(componentContext.getProperties());
    }

    public void configure(Dictionary<?, ?> properties) {
        this.username = PropertiesUtil.toString(properties.get("username"),null);
        this.password = PropertiesUtil.toString(properties.get("password"),
                null);
        this.enabled = PropertiesUtil.toBoolean(properties.get("prop.enabled"),false);
    }

    public void  run() {
        LOGGER.debug("Running");    
    }
}

简单明了:

元类型 =

阅读手册:http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-annotations.html