1 24 25 package org.objectweb.perseus; 26 27 import org.objectweb.perseus.cache.api.CacheEntryFactory; 28 import org.objectweb.perseus.cache.lib.BasicCacheManager; 29 import org.objectweb.perseus.cache.replacement.lib.AbstractReplacementManager; 30 import org.objectweb.perseus.persistence.api.MemoryInstanceManager; 31 import org.objectweb.perseus.persistence.api.StateManager; 32 import org.objectweb.perseus.persistence.api.StorageManager; 33 import org.objectweb.perseus.persistence.api.WorkingSetManager; 34 import org.objectweb.perseus.persistence.lib.TransactionalPersistenceManagerImpl; 35 import org.objectweb.perseus.concurrency.api.ConcurrencyManager; 36 import org.objectweb.perseus.dependency.lib.BasicDependencyGraph; 37 import org.objectweb.fractal.api.control.BindingController; 38 39 public class TPMTest extends TransactionalPersistenceManagerImpl { 40 41 protected CacheEntryFactory cef; 42 43 44 public TPMTest(ConcurrencyManager cm, AbstractReplacementManager rm) throws Exception { 45 super(); 46 StorageManager storageMgr = new StorageManagerTestImpl(); 47 StateManager stateMgr = new StateManagerTestImpl(); 48 MemoryInstanceManager aMim = new MemoryInstanceManagerTestImpl(); 49 WorkingSetManager wsMgr = new WorkingSetManagerTestImpl(); 50 BasicCacheManager cache = new BasicCacheManager(); 51 BasicDependencyGraph dg = new BasicDependencyGraph(); 52 53 bindFc(CACHE_MANAGER_BINDING, cache); 54 bindFc(CONCURRENCY_MANAGER_BINDING, cm); 55 bindFc(STORAGE_MANAGER_BINDING, storageMgr); 56 bindFc(MEMORY_INSTANCE_MANAGER_BINDING, aMim); 57 bindFc(UNBIND_MANAGER_BINDING, rm); 58 bindFc(WORKINGSET_MANAGER_BINDING, wsMgr); 59 bindFc("logger", LogBoot.getLoggerFactory().getLogger("tpm")); 60 bindFc(STATE_MANAGER_BINDING, stateMgr); 61 62 ((BindingController) cm).bindFc("dependency-graph", dg); 64 ((BindingController) cm).bindFc("storage-manager", storageMgr); 65 ((BindingController) cm).bindFc("state-manager", stateMgr); 66 ((BindingController) cm).bindFc("logger", LogBoot.getLoggerFactory().getLogger("tpm.cm")); 67 68 cache.bindFc(BasicCacheManager.CACHE_ENTRY_FACTORY_BINDING, new CacheEntryFactoryTestImpl()); 70 cache.bindFc(BasicCacheManager.CACHE_LISTENER_BINDING, stateMgr); 71 cache.bindFc("logger", LogBoot.getLoggerFactory().getLogger("tpm.cache")); 72 cache.bindFc(BasicCacheManager.REPLACEMENT_MANAGER_BINDING, rm); 73 cache.startFc(); 74 75 rm.bindFc("logger", LogBoot.getLoggerFactory().getLogger("tpm.rm")); 77 rm.bindFc(AbstractReplacementManager.UNBIND_MANAGER_BINDING, cache); 78 79 } 80 81 } 82 | Popular Tags |