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