KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > scheduler > JobWrapper


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 /* $Id: JobWrapper.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.cms.scheduler;
21
22 import org.quartz.JobDetail;
23 import org.quartz.Trigger;
24
25 /**
26  * Wrapper for job information.
27  */

28 public class JobWrapper {
29     
30     private JobDetail jobDetail;
31     private Trigger trigger;
32     
33     /**
34      * Ctor.
35      * @param detail The job detail.
36      * @param trigger The trigger.
37      */

38     public JobWrapper(JobDetail detail, Trigger trigger) {
39         this.jobDetail = detail;
40         this.trigger = trigger;
41     }
42     
43     /**
44      * Returns the job detail.
45      * @return A job detail object.
46      */

47     public JobDetail getJobDetail() {
48         return jobDetail;
49     }
50     
51     /**
52      * Returns the servlet job.
53      * @return A servlet job.
54      */

55     public ServletJob getJob() {
56         ServletJob job = ServletJobFactory.createJob(jobDetail.getJobClass());
57         return job;
58     }
59     
60     /**
61      * Returns the trigger.
62      * @return A trigger.
63      */

64     public Trigger getTrigger() {
65         return trigger;
66     }
67
68 }
69
Popular Tags