in src/main/java/org/apache/sling/event/impl/jobs/JobConsumerManager.java [319:349]
private void bindService(final ServiceReference<?> serviceReference, final boolean isConsumer) {
final String[] topics = PropertiesUtil.toStringArray(serviceReference.getProperty(JobConsumer.PROPERTY_TOPICS));
if ( topics != null && topics.length > 0 ) {
final ConsumerInfo info = new ConsumerInfo(serviceReference, isConsumer);
boolean changed = false;
synchronized ( this.topicToConsumerMap ) {
for(final String t : topics) {
if ( t != null ) {
final String topic = t.trim();
if ( topic.length() > 0 ) {
List<ConsumerInfo> consumers = this.topicToConsumerMap.get(topic);
if ( consumers == null ) {
consumers = new ArrayList<>();
this.topicToConsumerMap.put(topic, consumers);
changed = true;
}
consumers.add(info);
Collections.sort(consumers);
}
}
}
if ( changed ) {
this.calculateTopics(this.propagationService != null);
}
}
if ( changed && this.propagationService != null ) {
logger.debug("Updating property provider with: {}", this.topics);
this.propagationService.setProperties(this.getRegistrationProperties());
}
}
}