sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1633882 - in /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event: impl/jobs/JobManagerImpl.java impl/jobs/config/InternalQueueConfiguration.java impl/jobs/deprecated/EventAdminBridge.java jobs/JobManager.java
Date Thu, 23 Oct 2014 16:51:57 GMT
Author: cziegeler
Date: Thu Oct 23 16:51:57 2014
New Revision: 1633882

URL: http://svn.apache.org/r1633882
Log:
SLING-4095 : Clean up code and logging statements

Modified:
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/InternalQueueConfiguration.java
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/deprecated/EventAdminBridge.java
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobManager.java

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java?rev=1633882&r1=1633881&r2=1633882&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
Thu Oct 23 16:51:57 2014
@@ -175,7 +175,7 @@ public class JobManagerImpl
     @Override
     public void restart() {
         // nothing to do as this is deprecated, let's log a warning
-        logger.warn("Deprecated JobManager.restart() is called.");
+        logger.warn("DEPRECATION-WARNING: Deprecated JobManager.restart() is called.");
     }
 
     /**
@@ -183,6 +183,7 @@ public class JobManagerImpl
      */
     @Override
     public boolean isJobProcessingEnabled() {
+        logger.warn("DEPRECATION-WARNING: Deprecated JobManager.isJobProcessingEnabled()
is called.");
         return true;
     }
 
@@ -246,6 +247,7 @@ public class JobManagerImpl
     public JobsIterator queryJobs(final QueryType type, final String topic,
             final long limit,
             final Map<String, Object>... templates) {
+        logger.warn("DEPRECATION-WARNING: Deprecated JobManager.queryJobs(...) is called.");
         final Collection<Job> list = this.findJobs(type, topic, limit, templates);
         final Iterator<Job> iter = list.iterator();
         return new JobsIterator() {
@@ -297,6 +299,7 @@ public class JobManagerImpl
 
     @Override
     public Event findJob(final String topic, final Map<String, Object> template) {
+        logger.warn("DEPRECATION-WARNING: Deprecated JobManager.findJob(...) is called.");
         final Job job = this.getJob(topic, template);
         if ( job != null ) {
             return Utility.toEvent(job);
@@ -309,6 +312,7 @@ public class JobManagerImpl
      */
     @Override
     public boolean removeJob(final String jobId) {
+        logger.warn("DEPRECATION-WARNING: Deprecated JobManager.removeJob(...) is called.");
         return this.internalRemoveJobById(jobId, false);
     }
 
@@ -372,6 +376,7 @@ public class JobManagerImpl
      */
     @Override
     public void forceRemoveJob(final String jobId) {
+        logger.warn("DEPRECATION-WARNING: Deprecated JobManager.forceRemoveJob(...) is called.");
         this.internalRemoveJobById(jobId, true);
     }
 
@@ -388,6 +393,7 @@ public class JobManagerImpl
      */
     @Override
     public Job addJob(final String topic, final String name, final Map<String, Object>
properties) {
+        logger.warn("DEPRECATION-WARNING: Deprecated JobManager.add(String, String, Map)
is called.");
         return this.addJob(topic, name, properties, null);
     }
 
@@ -396,6 +402,7 @@ public class JobManagerImpl
      */
     @Override
     public Job getJobByName(final String name) {
+        logger.warn("DEPRECATION-WARNING: Deprecated JobManager.getJobByName(String) is called.");
         final StringBuilder buf = new StringBuilder(64);
 
         final ResourceResolver resolver = this.configuration.createResourceResolver();
@@ -959,7 +966,7 @@ public class JobManagerImpl
             return null;
         }
         if ( name != null ) {
-            logger.info("Job is using deprecated name feature: {}", Utility.toString(topic,
name, properties));
+            logger.info("DEPRECATION-WARNING: Job is using deprecated name feature: {}",
Utility.toString(topic, name, properties));
         }
         Job result = this.addJobInteral(topic, name, properties, errors);
         if ( result == null && name != null ) {

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/InternalQueueConfiguration.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/InternalQueueConfiguration.java?rev=1633882&r1=1633881&r2=1633882&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/InternalQueueConfiguration.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/InternalQueueConfiguration.java
Thu Oct 23 16:51:57 2014
@@ -229,7 +229,7 @@ public class InternalQueueConfiguration
             }
         }
         if ( type == Type.IGNORE || type == Type.DROP ) {
-            logger.warn("Queue is using deprecated queue type. Ignoring queue {} with type
{}", name, type);
+            logger.warn("DEPRECATION-WARNING: Queue is using deprecated queue type. Ignoring
queue {} with type {}", name, type);
             return false;
         }
         return true;

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/deprecated/EventAdminBridge.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/deprecated/EventAdminBridge.java?rev=1633882&r1=1633881&r2=1633882&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/deprecated/EventAdminBridge.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/deprecated/EventAdminBridge.java
Thu Oct 23 16:51:57 2014
@@ -165,7 +165,7 @@ public class EventAdminBridge
                     // check for deprecated/unsupported properties
                     for(final String ignoredProp : IGNORED_CONFIG_PROPERTIES) {
                         if ( props.containsKey(ignoredProp)) {
-                            logger.info("Job {} is using deprecated and ignored property
{}", EventUtil.toString(event), ignoredProp);
+                            logger.info("DEPRECATION-WARNING: Job {} is using deprecated
and ignored property {}", EventUtil.toString(event), ignoredProp);
                             props.remove(ignoredProp);
                         }
                     }
@@ -185,7 +185,7 @@ public class EventAdminBridge
         }
         // we ignore remote job events
         if ( EventUtil.isLocal(event) ) {
-            logger.info("Received job via deprecated OSGi event {}", EventUtil.toString(event));
+            logger.info("DEPRECATION-WARNING: Received job via deprecated OSGi event {}",
EventUtil.toString(event));
             // check job topic
             final String errorMessage = Utility.checkJobTopic(event.getProperty(ResourceHelper.PROPERTY_JOB_TOPIC));
             if ( errorMessage == null ) {

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobManager.java?rev=1633882&r1=1633881&r2=1633882&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobManager.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/jobs/JobManager.java
Thu Oct 23 16:51:57 2014
@@ -74,15 +74,6 @@ public interface JobManager {
     }
 
     /**
-     * Restart the job manager.
-     * This method restarts the job manager and all queues - currently processed jobs will
be finished.
-     * The job manager should only be restarted if really necessary!
-     * @deprecated This method does nothing
-     */
-    @Deprecated
-    void restart();
-
-    /**
      * Add a new job
      *
      * If the topic is <code>null</code> or illegal, no job is created and <code>null</code>
is returned.
@@ -218,6 +209,15 @@ public interface JobManager {
     Collection<ScheduledJobInfo> getScheduledJobs(String topic, long limit, Map<String,
Object>... templates);
 
     /**
+     * Restart the job manager.
+     * This method restarts the job manager and all queues - currently processed jobs will
be finished.
+     * The job manager should only be restarted if really necessary!
+     * @deprecated This method does nothing
+     */
+    @Deprecated
+    void restart();
+
+    /**
      * Add a new job
      *
      * If the topic is <code>null</code> or illegal, no job is created and <code>null</code>
is returned.



Mime
View raw message