01: /**
02: *
03: */package clime.messadmin.servletstats;
04:
05: import java.util.Hashtable;
06: import java.util.Map;
07:
08: import clime.messadmin.model.Application;
09: import clime.messadmin.model.Session;
10: import clime.messadmin.providers.lifecycle.ServletStatsGatherer;
11:
12: /**
13: * @author Cédrik LIME
14: */
15: public class Utils {
16: private static final String USER_DATA_KEY = ServletStatsGatherer.class
17: .getName();
18:
19: private Utils() {
20: }
21:
22: public static Map getPluginData(Application application) {
23: Map result = (Map) application.getUserData().get(USER_DATA_KEY);
24: if (result == null) {
25: result = new Hashtable();
26: application.getUserData().put(USER_DATA_KEY, result);
27: }
28: return result;
29: }
30:
31: public static Map getPluginData(Session session) {
32: Map result = (Map) session.getUserData().get(USER_DATA_KEY);
33: if (result == null) {
34: result = new Hashtable();
35: session.getUserData().put(USER_DATA_KEY, result);
36: }
37: return result;
38: }
39: }
|