1 16 package org.springframework.webflow.context.servlet; 17 18 import java.util.Map ; 19 20 import javax.servlet.http.HttpSessionBindingEvent ; 21 import javax.servlet.http.HttpSessionBindingListener ; 22 23 import org.springframework.webflow.core.collection.AttributeMapBindingEvent; 24 import org.springframework.webflow.core.collection.AttributeMapBindingListener; 25 import org.springframework.webflow.core.collection.LocalAttributeMap; 26 27 34 public class HttpSessionMapBindingListener implements HttpSessionBindingListener { 35 36 private AttributeMapBindingListener listener; 37 38 private Map sessionMap; 39 40 45 public HttpSessionMapBindingListener(AttributeMapBindingListener listener, Map sessionMap) { 46 this.listener = listener; 47 this.sessionMap = sessionMap; 48 } 49 50 53 public AttributeMapBindingListener getListener() { 54 return listener; 55 } 56 57 60 public Map getSessionMap() { 61 return sessionMap; 62 } 63 64 public void valueBound(HttpSessionBindingEvent event) { 65 listener.valueBound(getContextBindingEvent(event)); 66 } 67 68 public void valueUnbound(HttpSessionBindingEvent event) { 69 listener.valueUnbound(getContextBindingEvent(event)); 70 } 71 72 76 private AttributeMapBindingEvent getContextBindingEvent(HttpSessionBindingEvent event) { 77 return new AttributeMapBindingEvent(new LocalAttributeMap(sessionMap), event.getName(), listener); 78 } 79 } | Popular Tags |