You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2014/10/22 17:44:01 UTC

svn commit: r1633639 - in /sling/trunk/bundles/extensions/event/src: main/java/org/apache/sling/event/impl/jobs/ main/java/org/apache/sling/event/impl/jobs/tasks/ test/java/org/apache/sling/event/it/

Author: cziegeler
Date: Wed Oct 22 15:44:00 2014
New Revision: 1633639

URL: http://svn.apache.org/r1633639
Log:
Pass http port configuration to pax framework, remove unused code, reduce logger statements to debug level.

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/tasks/HistoryCleanUpTask.java
    sling/trunk/bundles/extensions/event/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.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=1633639&r1=1633638&r2=1633639&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 Wed Oct 22 15:44:00 2014
@@ -53,6 +53,7 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
+import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
@@ -78,6 +79,8 @@ import org.slf4j.LoggerFactory;
                     + "only used on the current instance. This option should always be disabled!")
 public class JobConsumerManager {
 
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
     @Property(unbounded=PropertyUnbounded.ARRAY, value = "*",
               label="Topic Whitelist",
               description="This is a list of topics which currently should be "
@@ -144,7 +147,7 @@ public class JobConsumerManager {
                 this.calculateTopics(enable);
             }
             if ( enable ) {
-                LoggerFactory.getLogger(this.getClass()).info("Registering property provider with: {}", this.topics);
+                logger.debug("Registering property provider with: {}", this.topics);
                 this.propagationService = bc.registerService(PropertyProvider.class.getName(),
                         new PropertyProvider() {
 
@@ -157,7 +160,7 @@ public class JobConsumerManager {
                             }
                         }, this.getRegistrationProperties());
             } else {
-                LoggerFactory.getLogger(this.getClass()).info("Unregistering property provider with");
+                logger.debug("Unregistering property provider with");
                 this.propagationService.unregister();
                 this.propagationService = null;
             }
@@ -166,7 +169,7 @@ public class JobConsumerManager {
             synchronized ( this.topicToConsumerMap ) {
                 this.calculateTopics(true);
             }
-            LoggerFactory.getLogger(this.getClass()).info("Updating property provider with: {}", this.topics);
+            logger.debug("Updating property provider with: {}", this.topics);
             this.propagationService.setProperties(this.getRegistrationProperties());
         }
     }
@@ -297,7 +300,7 @@ public class JobConsumerManager {
                 }
             }
             if ( changed && this.propagationService != null ) {
-                LoggerFactory.getLogger(this.getClass()).info("Updating property provider with: {}", this.topics);
+                logger.debug("Updating property provider with: {}", this.topics);
                 this.propagationService.setProperties(this.getRegistrationProperties());
             }
         }
@@ -347,7 +350,7 @@ public class JobConsumerManager {
                 }
             }
             if ( changed && this.propagationService != null ) {
-                LoggerFactory.getLogger(this.getClass()).info("Updating property provider with: {}", this.topics);
+                logger.debug("Updating property provider with: {}", this.topics);
                 this.propagationService.setProperties(this.getRegistrationProperties());
             }
         }

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java?rev=1633639&r1=1633638&r2=1633639&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java (original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/tasks/HistoryCleanUpTask.java Wed Oct 22 15:44:00 2014
@@ -233,14 +233,4 @@ public class HistoryCleanUpTask implemen
             }
         }
     }
-
-    /**
-     * Helper method which just logs the exception in debug mode.
-     * @param e
-     */
-    private void ignoreException(final Exception e) {
-        if ( this.logger.isDebugEnabled() ) {
-            this.logger.debug("Ignored exception " + e.getMessage(), e);
-        }
-    }
 }

Modified: sling/trunk/bundles/extensions/event/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java?rev=1633639&r1=1633638&r2=1633639&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java (original)
+++ sling/trunk/bundles/extensions/event/src/test/java/org/apache/sling/event/it/AbstractJobHandlingTest.java Wed Oct 22 15:44:00 2014
@@ -69,6 +69,8 @@ public abstract class AbstractJobHandlin
     @Inject
     protected BundleContext bc;
 
+    private static final String PORT_CONFIG = "org.osgi.service.http.port";
+
     @Configuration
     public Option[] config() {
         final String bundleFileName = System.getProperty( BUNDLE_JAR_SYS_PROP );
@@ -84,6 +86,8 @@ public abstract class AbstractJobHandlin
                 when( localRepo.length() > 0 ).useOptions(
                         systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo)
                 ),
+                when( System.getProperty(PORT_CONFIG) != null ).useOptions(
+                        systemProperty(PORT_CONFIG).value(System.getProperty(PORT_CONFIG))),
                 mavenBundle("org.apache.sling", "org.apache.sling.fragment.xml", "1.0.2"),
                 mavenBundle("org.apache.sling", "org.apache.sling.fragment.transaction", "1.0.0"),
                 mavenBundle("org.apache.sling", "org.apache.sling.fragment.activation", "1.0.2"),
@@ -109,7 +113,9 @@ public abstract class AbstractJobHandlin
                 mavenBundle("org.apache.tika", "tika-core", "1.2"),
                 mavenBundle("org.apache.tika", "tika-bundle", "1.2"),
 
-                mavenBundle("org.apache.felix", "org.apache.felix.http.jetty", "2.2.2"),
+                mavenBundle("org.apache.felix", "org.apache.felix.http.servlet-api", "1.0.0"),
+                mavenBundle("org.apache.felix", "org.apache.felix.http.api", "2.3.0"),
+                mavenBundle("org.apache.felix", "org.apache.felix.http.jetty", "2.3.0"),
                 mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.4.2"),
                 mavenBundle("org.apache.felix", "org.apache.felix.scr", "1.8.2"),
                 mavenBundle("org.apache.felix", "org.apache.felix.configadmin", "1.8.0"),
@@ -132,7 +138,7 @@ public abstract class AbstractJobHandlin
                 mavenBundle("org.apache.sling", "org.apache.sling.settings", "1.3.4"),
                 mavenBundle("org.apache.sling", "org.apache.sling.resourceresolver", "1.1.6"),
                 mavenBundle("org.apache.sling", "org.apache.sling.adapter", "2.1.2"),
-                mavenBundle("org.apache.sling", "org.apache.sling.jcr.resource", "2.3.8"),
+                mavenBundle("org.apache.sling", "org.apache.sling.jcr.resource", "2.3.10"),
                 mavenBundle("org.apache.sling", "org.apache.sling.jcr.classloader", "3.2.2"),
                 mavenBundle("org.apache.sling", "org.apache.sling.jcr.contentloader", "2.1.8"),
                 mavenBundle("org.apache.sling", "org.apache.sling.engine", "2.3.6"),