KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quartz > core > JobRunShellFactory


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

18
19 /*
20  * Previously Copyright (c) 2001-2004 James House
21  */

22 package org.quartz.core;
23
24 import org.quartz.Scheduler;
25 import org.quartz.SchedulerConfigException;
26 import org.quartz.SchedulerException;
27
28 /**
29  * <p>
30  * Responsible for creating the instances of <code>{@link JobRunShell}</code>
31  * to be used within the <class>{@link QuartzScheduler}</code> instance.
32  * </p>
33  *
34  * <p>
35  * Although this interface looks a lot like an 'object pool', implementations
36  * do not have to support the re-use of instances. If an implementation does
37  * not wish to pool instances, then the <code>borrowJobRunShell()</code>
38  * method would simply create a new instance, and the <code>returnJobRunShell
39  * </code> method would do nothing.
40  * </p>
41  *
42  * @author James House
43  */

44 public interface JobRunShellFactory {
45
46     /*
47      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48      *
49      * Interface.
50      *
51      * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52      */

53
54     /**
55      * <p>
56      * Initialize the factory, providing a handle to the <code>Scheduler</code>
57      * that should be made available within the <code>JobRunShell</code> and
58      * the <code>JobExecutionCOntext</code> s within it, and a handle to the
59      * <code>SchedulingContext</code> that the shell will use in its own
60      * operations with the <code>JobStore</code>.
61      * </p>
62      */

63     void initialize(Scheduler scheduler, SchedulingContext schedCtxt)
64         throws SchedulerConfigException;
65
66     /**
67      * <p>
68      * Called by the <code>{@link org.quartz.core.QuartzSchedulerThread}</code>
69      * to obtain instances of <code>{@link JobRunShell}</code>.
70      * </p>
71      */

72     JobRunShell borrowJobRunShell() throws SchedulerException;
73
74     /**
75      * <p>
76      * Called by the <code>{@link org.quartz.core.QuartzSchedulerThread}</code>
77      * to return instances of <code>{@link JobRunShell}</code>.
78      * </p>
79      */

80     void returnJobRunShell(JobRunShell jobRunShell);
81
82 }
Popular Tags