1 package se.anatom.ejbca.util; 2 3 import java.util.HashMap ; 4 5 import javax.ejb.EJBException ; 6 import javax.ejb.EJBLocalHome ; 7 import javax.ejb.FinderException ; 8 import javax.ejb.RemoveException ; 9 10 14 public class DummyLocalHome implements EJBLocalHome { 15 private HashMap map; 16 public DummyLocalHome(HashMap map){ 17 this.map = map; 18 } 19 public DummyLocalHome(){ 20 this.map = null; 21 } 22 public Object findByPrimaryKey(Integer pk) throws FinderException { 23 if (map == null) { 24 return ""; 25 } 26 Object o = map.get(pk); 27 if (o == null) throw new FinderException ("thrown on purpose to simulate non existing object"); 28 return o; 29 } 30 public void remove(Object o) throws RemoveException , EJBException { 31 } 32 } 33 | Popular Tags |