ionutzpi commented on code in PR #43: URL: https://github.com/apache/sling-org-apache-sling-event/pull/43#discussion_r2086270189
########## src/main/java/org/apache/sling/event/impl/jobs/queues/JobQueueImpl.java: ########## @@ -169,7 +169,7 @@ public static JobQueueImpl createQueue(final String name, * @param cache The job cache * @param outdatedQueue */ - private JobQueueImpl(final String name, + public JobQueueImpl(final String name, Review Comment: Made it protected. ########## 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: Added. -- 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