1 package org.apache.turbine.modules.scheduledjob;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import org.apache.turbine.modules.ScheduledJob;
20 import org.apache.turbine.services.schedule.JobEntry;
21
22 /***
23 * Simple job for use with unit testing of the scheduler service. This
24 * job merely increments a static counter variable when it is run. You
25 * can check the counter to verify the job has run.
26 *
27 * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
28 * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
29 * @version $Id: SimpleJob.java 264148 2005-08-29 14:21:04Z henning $
30 */
31 public class SimpleJob
32 extends ScheduledJob
33 {
34 /*** The test counter */
35 private static int counter = 0;
36
37 /***
38 * Run the Jobentry from the scheduler queue.
39 *
40 * @param job The job to run.
41 * @throws java.lang.Exception generic exception
42 */
43 public void run(JobEntry job)
44 throws Exception
45 {
46 counter++;
47 System.out.println("\n\nI AM RUNNING!\n\n");
48
49 }
50 /***
51 * Returns the counter value.
52 *
53 * @return The counter value
54 */
55 public static int getCounter()
56 {
57 return counter;
58 }
59
60 /***
61 * Sets the counter.
62 *
63 * @param i The new counter value
64 */
65 public static void setCounter(int i)
66 {
67 counter = i;
68 }
69 }