2016-09-19 4 views
0

스케줄러를 사용하여 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");  
    } 
} 

답변

관련 문제