01: /*
02: * Copyright 2004-2005 OpenSymphony
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy
06: * of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations
14: * under the License.
15: *
16: */
17:
18: /*
19: * Previously Copyright (c) 2001-2004 James House
20: */
21: package org.quartz;
22:
23: /**
24: * <p>
25: * The interface to be implemented by classes which represent a 'job' to be
26: * performed.
27: * </p>
28: *
29: * <p>
30: * Instances of <code>Job</code> must have a <code>public</code>
31: * no-argument constructor.
32: * </p>
33: *
34: * <p>
35: * <code>JobDataMap</code> provides a mechanism for 'instance member data'
36: * that may be required by some implementations of this interface.
37: * </p>
38: *
39: * @see JobDetail
40: * @see StatefulJob
41: * @see Trigger
42: * @see Scheduler
43: *
44: * @author James House
45: */
46: public interface Job {
47:
48: /*
49: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50: *
51: * Interface.
52: *
53: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54: */
55:
56: /**
57: * <p>
58: * Called by the <code>{@link Scheduler}</code> when a <code>{@link Trigger}</code>
59: * fires that is associated with the <code>Job</code>.
60: * </p>
61: *
62: * <p>
63: * The implementation may wish to set a
64: * {@link JobExecutionContext#setResult(Object) result} object on the
65: * {@link JobExecutionContext} before this method exits. The result itself
66: * is meaningless to Quartz, but may be informative to
67: * <code>{@link JobListener}s</code> or
68: * <code>{@link TriggerListener}s</code> that are watching the job's
69: * execution.
70: * </p>
71: *
72: * @throws JobExecutionException
73: * if there is an exception while executing the job.
74: */
75: void execute(JobExecutionContext context)
76: throws JobExecutionException;
77:
78: }
|