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 2013/07/26 15:55:20 UTC
svn commit: r1507316 - in
/sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler:
ScheduleOptions.java Scheduler.java
Author: cziegeler
Date: Fri Jul 26 13:55:20 2013
New Revision: 1507316
URL: http://svn.apache.org/r1507316
Log:
Update javadocs
Modified:
sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/ScheduleOptions.java
sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/Scheduler.java
Modified: sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/ScheduleOptions.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/ScheduleOptions.java?rev=1507316&r1=1507315&r2=1507316&view=diff
==============================================================================
--- sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/ScheduleOptions.java (original)
+++ sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/ScheduleOptions.java Fri Jul 26 13:55:20 2013
@@ -51,6 +51,8 @@ public interface ScheduleOptions {
/**
* Flag indicating whether the job should only be run on the leader.
* This defaults to false.
+ * If no topology information is available (= no Apache Sling Discovery Implementation active)
+ * this flag is ignored and the job is run on all instances.
* @param flag Whether this job should only be run on the leader
*/
ScheduleOptions onLeaderOnly(final boolean flag);
Modified: sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/Scheduler.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/Scheduler.java?rev=1507316&r1=1507315&r2=1507316&view=diff
==============================================================================
--- sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/Scheduler.java (original)
+++ sling/trunk/bundles/commons/scheduler/src/main/java/org/apache/sling/commons/scheduler/Scheduler.java Fri Jul 26 13:55:20 2013
@@ -26,6 +26,15 @@ import java.util.NoSuchElementException;
* A job is an object that is executed/fired by the scheduler. The object
* should either implement the {@link Job} interface or the {@link Runnable}
* interface.
+ *
+ * A job can be scheduled either by creating a {@link ScheduleOptions} instance
+ * through one of the scheduler methods and then calling {@link #schedule(Object, ScheduleOptions)}
+ * or
+ * by using the whiteboard pattern and registering a Runnable service with either
+ * the {@link #PROPERTY_SCHEDULER_EXPRESSION} or {@link #PROPERTY_SCHEDULER_PERIOD}
+ * property. Services registered by the whiteboard pattern can by default run concurrently,
+ * which usually is not wanted. Therefore it is advisable to also set the
+ * {@link #PROPERTY_SCHEDULER_CONCURRENT} property with Boolean.FALSE.
*/
public interface Scheduler {
@@ -54,6 +63,8 @@ public interface Scheduler {
/** Name of the configuration property to define if the job should only be run on the leader.
* Default is to start the job on all instances. This property needs to be of type Boolean.
+ * If no topology information is available (= no Apache Sling Discovery Implementation active)
+ * this flag is ignored and the job is run on all instances.
* @since 2.3.0
*/
String PROPERTY_SCHEDULER_LEADER_ONLY = "scheduler.leaderonly";