Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
KNSGlobalVariables |
|
| 1.0;1 | ||||
KNSGlobalVariables$1 |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 1.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl1.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
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.AuditCluster; | |
20 | import org.kuali.rice.krad.util.GlobalVariables; | |
21 | import org.kuali.rice.krad.util.MessageMap; | |
22 | ||
23 | import java.util.HashMap; | |
24 | ||
25 | /** | |
26 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
27 | */ | |
28 | @Deprecated | |
29 | 0 | public class KNSGlobalVariables extends GlobalVariables { |
30 | ||
31 | 0 | private static ThreadLocal<KualiForm> kualiForms = new ThreadLocal<KualiForm>(); |
32 | ||
33 | 0 | private static ThreadLocal<MessageList> messageLists = new ThreadLocal<MessageList>() { |
34 | @Override | |
35 | protected MessageList initialValue() { | |
36 | 0 | return new MessageList(); |
37 | } | |
38 | }; | |
39 | ||
40 | /** | |
41 | * @return ArrayList containing messages. | |
42 | */ | |
43 | public static MessageList getMessageList() { | |
44 | 0 | return messageLists.get(); |
45 | } | |
46 | ||
47 | /** | |
48 | * Sets a new message list | |
49 | * | |
50 | * @param messageList | |
51 | */ | |
52 | public static void setMessageList(MessageList messageList) { | |
53 | 0 | messageLists.set(messageList); |
54 | 0 | } |
55 | ||
56 | /** | |
57 | * @return KualiForm that has been assigned to this thread of execution. | |
58 | */ | |
59 | @Deprecated | |
60 | public static KualiForm getKualiForm() { | |
61 | 0 | return kualiForms.get(); |
62 | } | |
63 | ||
64 | /** | |
65 | * sets the kualiForm object into the global variable for this thread | |
66 | * | |
67 | * @param kualiForm | |
68 | */ | |
69 | @Deprecated | |
70 | public static void setKualiForm(KualiForm kualiForm) { | |
71 | 0 | kualiForms.set(kualiForm); |
72 | 0 | } |
73 | ||
74 | public static void clear() { | |
75 | 0 | GlobalVariables.clear(); |
76 | 0 | messageLists.set(new MessageList()); |
77 | 0 | kualiForms.set(null); |
78 | 0 | } |
79 | } |