incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1481117 - in /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs: JobConsumerManager.java TopologyCapabilities.java
Date Fri, 10 May 2013 17:42:21 GMT
Author: cziegeler
Date: Fri May 10 17:42:21 2013
New Revision: 1481117

URL: http://svn.apache.org/r1481117
Log:
SLING-2829 :  Add API for starting a job and service interface for executing a job 

Modified:
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobConsumerManager.java
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/TopologyCapabilities.java

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobConsumerManager.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobConsumerManager.java?rev=1481117&r1=1481116&r2=1481117&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobConsumerManager.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobConsumerManager.java
Fri May 10 17:42:21 2013
@@ -87,7 +87,7 @@ public class JobConsumerManager {
 
     private Dictionary<String, Object> getRegistrationProperties() {
         final Dictionary<String, Object> serviceProps = new Hashtable<String, Object>();
-        serviceProps.put(PropertyProvider.PROPERTY_PROPERTIES, JobConsumer.PROPERTY_TOPICS);
+        serviceProps.put(PropertyProvider.PROPERTY_PROPERTIES, TopologyCapabilities.PROPERTY_TOPICS);
         // we add a changing property to the service registration
         // to make sure a modification event is really sent
         synchronized ( this ) {
@@ -120,7 +120,7 @@ public class JobConsumerManager {
 
                             @Override
                             public String getProperty(final String name) {
-                                if ( JobConsumer.PROPERTY_TOPICS.equals(name) ) {
+                                if ( TopologyCapabilities.PROPERTY_TOPICS.equals(name) )
{
                                     return topics;
                                 }
                                 return null;

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/TopologyCapabilities.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/TopologyCapabilities.java?rev=1481117&r1=1481116&r2=1481117&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/TopologyCapabilities.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/TopologyCapabilities.java
Fri May 10 17:42:21 2013
@@ -31,7 +31,6 @@ import org.apache.sling.discovery.Topolo
 import org.apache.sling.event.impl.jobs.config.QueueConfigurationManager.QueueInfo;
 import org.apache.sling.event.impl.support.Environment;
 import org.apache.sling.event.jobs.QueueConfiguration;
-import org.apache.sling.event.jobs.consumer.JobConsumer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -40,6 +39,8 @@ import org.slf4j.LoggerFactory;
  */
 public class TopologyCapabilities {
 
+    public static final String PROPERTY_TOPICS = "org.apache.sling.event.jobs.consumer.topics";
+
     /** Logger. */
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
@@ -107,7 +108,7 @@ public class TopologyCapabilities {
         final Map<String, String> allInstances = new TreeMap<String, String>();
 
         for(final InstanceDescription desc : view.getInstances() ) {
-            final String topics = desc.getProperty(JobConsumer.PROPERTY_TOPICS);
+            final String topics = desc.getProperty(PROPERTY_TOPICS);
             if ( topics != null && topics.length() > 0 ) {
                 allInstances.put(desc.getSlingId(), topics);
             } else {
@@ -125,7 +126,7 @@ public class TopologyCapabilities {
         this.allInstances = getAllInstancesMap(view);
         final Map<String, List<InstanceDescription>> newCaps = new HashMap<String,
List<InstanceDescription>>();
         for(final InstanceDescription desc : view.getInstances() ) {
-            final String topics = desc.getProperty(JobConsumer.PROPERTY_TOPICS);
+            final String topics = desc.getProperty(PROPERTY_TOPICS);
             if ( topics != null && topics.length() > 0 ) {
                 this.logger.debug("Capabilities of {} : {}", desc.getSlingId(), topics);
                 for(final String topic : topics.split(",") ) {



Mime
View raw message