Commits

Zemian Deng committed a6e45e4

Fixed few FindBug warnings - use final on constants, and limit field access on JobListenerService.

Comments (0)

Files changed (3)

timemachine-scheduler/src/main/java/timemachine/scheduler/jobtask/LoggerJobTask.java

  * @author Zemian Deng
  */
 public class LoggerJobTask implements JobTask {
-	public static Logger logger = LoggerFactory.getLogger(LoggerJobTask.class);
-	public static String MSG_KEY = "msg";
-
+	private static Logger logger = LoggerFactory.getLogger(LoggerJobTask.class);
+	public static final String MSG_KEY = "msg";
+	
 	@Override
 	public void run(JobContext jobContext) {
 		JobDef jobDef = jobContext.getJobDef();

timemachine-scheduler/src/main/java/timemachine/scheduler/jobtask/SleepyJobTask.java

  */
 public class SleepyJobTask implements JobTask {
 	private static Logger logger = LoggerFactory.getLogger(SleepyJobTask.class);
-	public static String SLEEP_TIME_KEY = "sleepTime";
+	public static final String SLEEP_TIME_KEY = "sleepTime";
 
 	@Override
 	public void run(JobContext jobContext) {

timemachine-scheduler/src/main/java/timemachine/scheduler/service/JobListenerService.java

  */
 public class JobListenerService extends AbstractService implements JobListener {
 
-	protected Scheduler scheduler;
+	private Scheduler scheduler;
+	
+	public Scheduler getScheduler() {
+		return scheduler;
+	}
 
 	@Override
 	public void onScheduler(Scheduler scheduler) {