1 6 7 package org.jfox.ejb; 8 9 import javax.ejb.EnterpriseBean ; 10 11 import org.jfox.pool.PoolableObject; 12 import org.jfox.pool.SimpleObjectFactory; 13 14 15 20 21 public class EJBObjectFactory extends SimpleObjectFactory { 22 23 private Bucket bucket = null; 25 26 32 public EJBObjectFactory(Class classType, Bucket bucket) throws Exception { 33 super(classType); 34 this.bucket = bucket; 35 } 36 37 public PoolableObject makeObject() throws Exception { 38 EJBPoolableObject pobj = (EJBPoolableObject) super.makeObject(); 39 EnterpriseBean bean = (EnterpriseBean ) bucket.getBeanClass().newInstance(); 40 pobj.setBeanInstance(bean); 41 return pobj; 42 } 43 44 public Bucket getBucket() { 45 return bucket; 46 } 47 48 public static void main(String [] args) { 49 50 } 51 } 52 | Popular Tags |