1 16 package org.apache.cocoon.portal.aspect.impl; 17 18 import java.util.HashMap ; 19 import java.util.Map ; 20 21 import org.apache.avalon.framework.component.Component; 22 import org.apache.avalon.framework.logger.AbstractLogEnabled; 23 import org.apache.avalon.framework.thread.ThreadSafe; 24 import org.apache.cocoon.portal.aspect.AspectDataStore; 25 import org.apache.cocoon.portal.aspect.Aspectalizable; 26 27 34 public class MemoryAspectDataStore 35 extends AbstractLogEnabled 36 implements Component, ThreadSafe, AspectDataStore { 37 38 protected final Map objectMap = new HashMap (); 39 40 43 protected Map getMap(Aspectalizable owner) { 44 Map result = (Map )this.objectMap.get(owner); 45 if ( result == null ) { 46 result = new HashMap (); 47 this.objectMap.put(owner, result); 48 } 49 return result; 50 } 51 52 55 public Object getAspectData(Aspectalizable owner, String aspectName) { 56 return this.getMap(owner).get( aspectName ); 57 } 58 59 62 public void setAspectData(Aspectalizable owner, String aspectName, Object data) { 63 this.getMap(owner).put(aspectName, data); 64 } 65 66 69 public boolean isPersistent() { 70 return false; 71 } 72 73 } 74 | Popular Tags |