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 2008/02/19 15:00:23 UTC
svn commit: r629099 - in
/incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler:
Job.java JobContext.java
Author: cziegeler
Date: Tue Feb 19 06:00:19 2008
New Revision: 629099
URL: http://svn.apache.org/viewvc?rev=629099&view=rev
Log:
Add some javadocs.
Modified:
incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/Job.java
incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/JobContext.java
Modified: incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/Job.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/Job.java?rev=629099&r1=629098&r2=629099&view=diff
==============================================================================
--- incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/Job.java (original)
+++ incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/Job.java Tue Feb 19 06:00:19 2008
@@ -16,8 +16,19 @@
*/
package org.apache.sling.scheduler;
-
+/**
+ * A job is executed by the {@link Scheduler} service.
+ * If the implementation of the job requires certain environment information
+ * it can implement this interface to get additional information
+ * through the provided {@link JobContext}.
+ * If no additional information is required, implementing {@link Runnable} is
+ * sufficient.
+ */
public interface Job {
+ /**
+ * Execute this job.
+ * @param context The context of the job.
+ */
void execute(JobContext context);
}
Modified: incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/JobContext.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/JobContext.java?rev=629099&r1=629098&r2=629099&view=diff
==============================================================================
--- incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/JobContext.java (original)
+++ incubator/sling/trunk/sling/scheduler/src/main/java/org/apache/sling/scheduler/JobContext.java Tue Feb 19 06:00:19 2008
@@ -21,6 +21,9 @@
import org.apache.sling.api.services.ServiceLocator;
+/**
+ * The context for a {@link Job}.
+ */
public interface JobContext {
/**
@@ -29,10 +32,15 @@
*/
String getName();
+ /**
+ * Get the configuration provided when the job was scheduled.
+ * @return A non-null map of values.
+ */
Map<String, Serializable> getConfiguration();
/**
* Get the service locator.
+ * The service locator can be used to retrieve additional services.
* @return The service locator.
*/
ServiceLocator getServiceLocator();