1 /*
2 * Copyright 2001-2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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.portletbridge.portlet;
17
18 import java.io.Serializable;
19 import java.util.HashMap;
20 import java.util.Map;
21
22 /***
23 * @author jmccrindle
24 */
25 public class DefaultValidationMemento implements ValidationMemento, Serializable {
26
27 /***
28 * default serial version id
29 */
30 private static final long serialVersionUID = 5856458092122115180L;
31
32 private Map validationInfoMap = new HashMap();
33
34 /***
35 * Default Constructor
36 */
37 public DefaultValidationMemento() {
38 super();
39 }
40
41 /* (non-Javadoc)
42 * @see org.portletbridge.portlet.ValidationMemento#getValidationInfo(java.lang.String)
43 */
44 public Map remove(String id) {
45 synchronized(validationInfoMap){
46 Map result = (Map) validationInfoMap.remove(id);
47 return result;
48 }
49 }
50
51 /* (non-Javadoc)
52 * @see org.portletbridge.portlet.ValidationMemento#put(java.lang.String, java.util.Map)
53 */
54 public void put(String id, Map map) {
55 synchronized(validationInfoMap){
56 validationInfoMap.put(id, map);
57 }
58 }
59
60 }