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