1 15 package org.apache.tapestry.engine.state; 16 17 import org.apache.hivemind.util.Defense; 18 19 23 public class StateObjectManagerImpl implements StateObjectManager 24 { 25 private StateObjectPersistenceManager _persistenceManager; 26 27 private StateObjectFactory _factory; 28 29 private String _name; 30 31 public StateObjectManagerImpl(String name, StateObjectFactory factory, 32 StateObjectPersistenceManager persistenceManager) 33 { 34 Defense.notNull(name, "name"); 35 Defense.notNull(factory, "factory"); 36 Defense.notNull(persistenceManager, "persistenceManager"); 37 38 _name = name; 39 _factory = factory; 40 _persistenceManager = persistenceManager; 41 } 42 43 public boolean exists() 44 { 45 return _persistenceManager.exists(_name); 46 } 47 48 public Object get() 49 { 50 return _persistenceManager.get(_name, _factory); 51 } 52 53 public void store(Object stateObject) 54 { 55 _persistenceManager.store(_name, stateObject); 56 } 57 } | Popular Tags |