stefan-egli commented on code in PR #43: URL: https://github.com/apache/sling-org-apache-sling-event/pull/43#discussion_r2086679696
########## src/main/java/org/apache/sling/event/impl/jobs/config/JobManagerConfiguration.java: ########## @@ -199,6 +202,50 @@ static JobManagerConfiguration newForTest(ResourceResolverFactory resourceResolv /** The topology capabilities. */ private volatile TopologyCapabilities topologyCapabilities; + /** The condition that determines if job processing is enabled. */ + @Reference( + target = "(osgi.condition.id=org.apache.sling.event.jobs.processing.enabled)", + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + policyOption = ReferencePolicyOption.GREEDY + ) + private volatile Condition jobProcessingEnabledCondition; + + /** + * Handle binding of the job processing condition. + * @param condition The condition being bound + */ + protected void bindJobProcessingEnabledCondition(final Condition condition) { + this.jobProcessingEnabledCondition = condition; + // If condition becomes true, trigger maintenance to start processing jobs + if (condition != null) { + notifyListeners(); + } + } + + /** + * Handle unbinding of the job processing condition. + * @param condition The condition being unbound + */ + protected void unbindJobProcessingEnabledCondition(final Condition condition) { + if (this.jobProcessingEnabledCondition == condition) { + this.jobProcessingEnabledCondition = null; Review Comment: actually, reading the log info, are we now supporting the condition to come and go arbitrarily? previously we required only one cycle (we could I guess support this, not sure if it has consequences, just wondering) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org