1 15 package org.apache.tapestry.engine.state; 16 17 import java.util.HashMap ; 18 import java.util.Map ; 19 20 28 public class ApplicationScopeManager implements StateObjectPersistenceManager 29 { 30 private Map _objects = new HashMap (); 31 32 public synchronized boolean exists(String objectName) 33 { 34 return false; 35 } 36 37 public synchronized Object get(String objectName, StateObjectFactory factory) 38 { 39 Object result = _objects.get(objectName); 40 41 if (result == null) 42 { 43 result = factory.createStateObject(); 44 _objects.put(objectName, result); 45 } 46 47 return result; 48 } 49 50 public synchronized void store(String objectName, Object stateObject) 51 { 52 _objects.put(objectName, stateObject); 53 } 54 55 } | Popular Tags |