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