1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.util;
17
18 import org.kuali.rice.core.framework.util.ApplicationThreadLocal;
19 import org.kuali.rice.kns.web.struts.form.KualiForm;
20 import org.kuali.rice.krad.util.GlobalVariables;
21
22 import java.util.HashMap;
23 import java.util.Map;
24
25
26
27
28 @Deprecated
29 public final class KNSGlobalVariables {
30
31 private KNSGlobalVariables() {
32 throw new UnsupportedOperationException("do not call");
33 }
34
35 private static ThreadLocal<KualiForm> kualiForms = new ApplicationThreadLocal<KualiForm>();
36
37 private static ThreadLocal<MessageList> messageLists = new ApplicationThreadLocal<MessageList>() {
38 @Override
39 protected MessageList initialValue() {
40 return new MessageList();
41 }
42 };
43
44 private static ThreadLocal<HashMap<String, AuditCluster>> auditErrorMaps = new ApplicationThreadLocal<HashMap<String, AuditCluster>>() {
45 @Override
46 protected HashMap<String, AuditCluster> initialValue() {
47 return new HashMap<String, AuditCluster>();
48 }
49 };
50
51
52
53
54 @Deprecated
55 public static MessageList getMessageList() {
56 return messageLists.get();
57 }
58
59
60
61
62
63
64 @Deprecated
65 public static void setMessageList(MessageList messageList) {
66 messageLists.set(messageList);
67 }
68
69
70
71
72 @Deprecated
73 public static KualiForm getKualiForm() {
74 return kualiForms.get();
75 }
76
77
78
79
80 @Deprecated
81 public static Map<String, AuditCluster> getAuditErrorMap() {
82 return auditErrorMaps.get();
83 }
84
85
86
87
88
89
90 @Deprecated
91 public static void setAuditErrorMap(HashMap<String, AuditCluster> errorMap) {
92 auditErrorMaps.set(errorMap);
93 }
94
95
96
97
98
99
100 @Deprecated
101 public static void setKualiForm(KualiForm kualiForm) {
102 kualiForms.set(kualiForm);
103 }
104
105 @Deprecated
106 public static void clear() {
107 GlobalVariables.clear();
108 messageLists.set(new MessageList());
109 auditErrorMaps.set(new HashMap<String, AuditCluster>());
110 kualiForms.set(null);
111 }
112 }