@Service(value=JobConsumerManager.class) @References(value={@Reference(referenceInterface=JobConsumer.class,cardinality=OPTIONAL_MULTIPLE,policy=DYNAMIC),@Reference(referenceInterface=JobExecutor.class,cardinality=OPTIONAL_MULTIPLE,policy=DYNAMIC)}) @Property(name="org.apache.sling.installer.configuration.persist", boolValue=false, label="Distribute config", description="If this is disabled, the configuration is not persisted on save in the cluster and is only used on the current instance. This option should always be disabled!") public class JobConsumerManager extends Object
Constructor and Description |
---|
JobConsumerManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.framework.BundleContext bc,
Map<String,Object> props) |
protected void |
bindJobConsumer(org.osgi.framework.ServiceReference serviceReference)
Bind a new consumer
|
protected void |
bindJobExecutor(org.osgi.framework.ServiceReference serviceReference)
Bind a new executor
|
protected void |
deactivate() |
JobExecutor |
getExecutor(String topic)
Get the executor for the topic.
|
String |
getTopics()
Return the topics information of this instance.
|
protected void |
modified(org.osgi.framework.BundleContext bc,
Map<String,Object> props) |
void |
registerListener(String key,
JobExecutor consumer,
JobExecutionContext handler) |
boolean |
supportsBridgedEvents()
Does this instance supports bridged events?
|
protected void |
unbindJobConsumer(org.osgi.framework.ServiceReference serviceReference)
Unbind a consumer
|
protected void |
unbindJobExecutor(org.osgi.framework.ServiceReference serviceReference)
Unbind a executor
|
void |
unregisterListener(String key) |
@Activate protected void activate(org.osgi.framework.BundleContext bc, Map<String,Object> props)
@Modified protected void modified(org.osgi.framework.BundleContext bc, Map<String,Object> props)
@Deactivate protected void deactivate()
public JobExecutor getExecutor(String topic)
topic
- The job topicnull
public void registerListener(String key, JobExecutor consumer, JobExecutionContext handler)
public void unregisterListener(String key)
public String getTopics()
public boolean supportsBridgedEvents()
protected void bindJobConsumer(org.osgi.framework.ServiceReference serviceReference)
serviceReference
- The service reference to the consumer.protected void unbindJobConsumer(org.osgi.framework.ServiceReference serviceReference)
serviceReference
- The service reference to the consumer.protected void bindJobExecutor(org.osgi.framework.ServiceReference serviceReference)
serviceReference
- The service reference to the executor.protected void unbindJobExecutor(org.osgi.framework.ServiceReference serviceReference)
serviceReference
- The service reference to the executor.Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.