1
14
15 package com.liferay.util.bridges.jsf.sun;
16
17 import java.util.AbstractMap;
18 import java.util.Set;
19
20 import javax.servlet.ServletContext;
21
22
27 public class LiferayApplicationMap extends AbstractMap<String, Object> {
28
29 public LiferayApplicationMap(ServletContext servletContext) {
30 _servletContext = servletContext;
31 }
32
33 public Set<Entry<String, Object>> entrySet() {
34 throw new UnsupportedOperationException();
35 }
36
37 public Object get(Object key) {
38 return _servletContext.getAttribute(key.toString());
39 }
40
41 public Object put(String key, Object value) {
42 Object previousValue = get(key);
43
44 _servletContext.setAttribute(key.toString(), value);
45
46 return previousValue;
47 }
48
49 public Object remove(Object key) {
50 Object value = null;
51
52 if (key != null) {
53 value = get(key);
54
55 _servletContext.removeAttribute(key.toString());
56 }
57
58 return value;
59 }
60
61 private ServletContext _servletContext;
62
63 }