1 24 25 package org.objectweb.perseus; 26 27 import org.objectweb.perseus.persistence.api.WorkingSetManager; 28 import org.objectweb.perseus.persistence.api.WorkingSet; 29 import org.objectweb.perseus.persistence.api.PersistenceException; 30 import org.objectweb.perseus.persistence.lib.BasicWorkingSet; 31 32 import java.util.HashSet ; 33 34 public class WorkingSetManagerTestImpl implements WorkingSetManager { 35 36 HashSet workingSets; 37 38 WorkingSetManagerTestImpl() { 39 workingSets = new HashSet (); 40 } 41 42 public WorkingSet createWS(Object userObject) 43 throws PersistenceException { 44 return createWS(userObject, null); 45 } 46 47 public WorkingSet createWS(Object userObject, 48 Object workingSetType) 49 throws PersistenceException { 50 WorkingSetTestImpl ws; 51 try { 52 ws = new WorkingSetTestImpl((String ) userObject); 53 ws.bindFc("logger", LogBoot.getLoggerFactory().getLogger("ws")); 54 } catch (Exception _) { 55 throw new PersistenceException("Cannot bin logget factory to working set"); 56 } 57 workingSets.add(ws); 58 return ws; 59 } 60 61 public void closeWS(WorkingSet ws) { 62 workingSets.remove(ws); 63 } 64 65 } 66 | Popular Tags |