KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cowsultants > itracker > web > scheduler > SchedulerUtilities


1 /*
2  * This software was designed and created by Jason Carroll.
3  * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4  * The author can be reached at jcarroll@cowsultants.com
5  * ITracker website: http://www.cowsultants.com
6  * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it only under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  */

18
19 package cowsultants.itracker.web.scheduler;
20
21 import java.util.*;
22
23 /**
24   * This class contains utilities for dealing with the Scheduler and Scheduler tasks.
25   */

26 public class SchedulerUtilities {
27     public static final String JavaDoc TASK_CLASS_REMINDER = "cowsultants.itracker.web.scheduler.tasks.ReminderNotification";
28     public static final String JavaDoc TASK_KEY_REMINDER = "itracker.web.admin.scheduler.task.reminder";
29
30     private static HashMap definedTasks;
31
32     static {
33         definedTasks = new HashMap();
34         definedTasks.put(TASK_CLASS_REMINDER, TASK_KEY_REMINDER);
35     }
36
37       public SchedulerUtilities() {
38       }
39
40     /**
41       * This returns a HashMap of defined task classes and their associated resource bundle key.
42       * @return a HashMap with the classes and keys of predefined tasks
43       */

44     public static HashMap getDefinedTasks() {
45         return definedTasks;
46     }
47
48
49     /**
50       * Returns the key associated with a class, or null if that class has not been defined.
51       * @param className the name of the class including the package to look up
52       * @return a sting containing the reosuce bundle key, or null if the class is not defined
53       */

54     public static String JavaDoc getClassKey(String JavaDoc className) {
55         if(definedTasks.containsKey(className)) {
56             return (String JavaDoc) definedTasks.get(className);
57         }
58         return null;
59     }
60 }
61
Popular Tags