1 17 18 package org.pentaho.core.session; 19 20 import java.util.HashMap ; 21 import java.util.Iterator ; 22 import java.util.Locale ; 23 24 import org.apache.commons.logging.Log; 25 import org.apache.commons.logging.LogFactory; 26 27 public class StandaloneSession extends BaseSession { 28 29 32 private static final long serialVersionUID = -1614831602086304014L; 33 34 private static final Log logger = LogFactory.getLog(StandaloneSession.class); 35 36 public Log getLogger() { 37 return logger; 38 } 39 40 private HashMap attributes; 41 42 public StandaloneSession(String name) { 43 this(name, name); 44 } 45 46 public StandaloneSession(String name, String id) { 47 this(name, id, Locale.getDefault()); 48 } 49 50 public StandaloneSession(String name, String id, Locale locale) { 51 super(name, id, locale); 52 attributes = new HashMap (); 53 } 54 55 public Iterator getAttributeNames() { 56 return attributes.keySet().iterator(); 58 } 59 60 public Object getAttribute(String attributeName) { 61 return attributes.get(attributeName); 62 } 63 64 public void setAttribute(String attributeName, Object value) { 65 attributes.put(attributeName, value); 66 } 67 68 public Object removeAttribute(String attributeName) { 69 Object result = getAttribute(attributeName); 70 attributes.remove(attributeName); 71 return result; 72 } 73 74 } 75
| Popular Tags
|