1 16 package org.springframework.webflow.context.servlet; 17 18 import java.util.Iterator ; 19 20 import javax.servlet.ServletContext ; 21 22 import org.springframework.binding.collection.SharedMap; 23 import org.springframework.binding.collection.StringKeyedMapAdapter; 24 import org.springframework.webflow.core.collection.CollectionUtils; 25 26 32 public class HttpServletContextMap extends StringKeyedMapAdapter implements SharedMap { 33 34 37 private ServletContext context; 38 39 42 public HttpServletContextMap(ServletContext context) { 43 this.context = context; 44 } 45 46 protected Object getAttribute(String key) { 47 return context.getAttribute(key); 48 } 49 50 protected void setAttribute(String key, Object value) { 51 context.setAttribute(key, value); 52 } 53 54 protected void removeAttribute(String key) { 55 context.removeAttribute(key); 56 } 57 58 protected Iterator getAttributeNames() { 59 return CollectionUtils.toIterator(context.getAttributeNames()); 60 } 61 62 public Object getMutex() { 63 return context; 64 } 65 } | Popular Tags |