KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > cron > QuartzJobStoreTX


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 package org.apache.cocoon.components.cron;
17
18 import org.apache.avalon.framework.context.Context;
19 import org.apache.avalon.framework.logger.Logger;
20 import org.apache.avalon.framework.service.ServiceManager;
21
22 import org.quartz.impl.jdbcjobstore.JobStoreTX;
23 import org.quartz.impl.jdbcjobstore.DriverDelegate;
24 import org.quartz.impl.jdbcjobstore.NoSuchDelegateException;
25
26 /**
27  * Overrides JobStoreTX's getDelegate method.
28  *
29  * @version CVS $Id: QuartzJobStoreTX.java 124799 2005-01-10 13:32:27Z vgritsenko $
30  * @since 2.1.6
31  */

32 public class QuartzJobStoreTX extends JobStoreTX {
33
34     private final Logger logger;
35     private final ServiceManager manager;
36     private final Context context;
37     private DriverDelegate delegate;
38
39     public QuartzJobStoreTX(Logger logger, ServiceManager manager, Context context) {
40         this.logger = logger;
41         this.manager = manager;
42         this.context = context;
43     }
44
45     protected DriverDelegate getDelegate() throws NoSuchDelegateException {
46         if (delegate == null) {
47             delegate = new QuartzDriverDelegate(this.logger, this.manager, this.context, super.getDelegate());
48         }
49
50         return delegate;
51     }
52 }
53
Popular Tags