1 28 29 package com.caucho.ejb.cfg; 30 31 import com.caucho.config.ConfigException; 32 import com.caucho.util.L10N; 33 34 import javax.annotation.PostConstruct; 35 36 40 public class EjbSessionConfigProxy extends EjbBeanConfigProxy { 41 private static final L10N L = new L10N(EjbBeanConfigProxy.class); 42 43 private EjbSessionBean _session; 44 45 48 public EjbSessionConfigProxy(EjbConfig config, String ejbModuleName) 49 { 50 super(config, ejbModuleName); 51 } 52 53 56 @PostConstruct 57 public void init() 58 throws Throwable 59 { 60 EjbBean oldBean = getConfig().getBeanConfig(getEJBName()); 61 62 if (oldBean == null) { 63 _session = new EjbSessionBean(getConfig(), getEJBModuleName()); 64 _session.setEJBName(getEJBName()); 65 _session.setLocation(getLocation()); 66 _session.setAllowPOJO(getConfig().isAllowPOJO()); 67 } 68 else if (! (oldBean instanceof EjbSessionBean)) { 69 throw new ConfigException(L.l("session bean `{0}' conflicts with prior {1} bean at {2}.", 70 getEJBName(), oldBean.getEJBKind(), 71 oldBean.getLocation())); 72 } 73 else 74 _session = (EjbSessionBean) oldBean; 75 76 _session.addDependencyList(getDependencyList()); 77 78 getBuilderProgram().configure(_session); 79 } 80 81 84 public EjbSessionBean getSession() 85 { 86 return _session; 87 } 88 } 89 | Popular Tags |