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 EjbMessageConfigProxy extends EjbBeanConfigProxy { 41 private static final L10N L = new L10N(EjbBeanConfigProxy.class); 42 43 private EjbMessageBean _message; 44 45 48 public EjbMessageConfigProxy(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 _message = new EjbMessageBean(getConfig(), getEJBModuleName()); 64 _message.setEJBName(getEJBName()); 65 _message.setLocation(getLocation()); 66 } 67 else if (! (oldBean instanceof EjbMessageBean)) { 68 throw new ConfigException(L.l("message bean `{0}' conflicts with prior {1} bean at {2}.", 69 getEJBName(), oldBean.getEJBKind(), 70 oldBean.getLocation())); 71 } 72 else 73 _message = (EjbMessageBean) oldBean; 74 75 _message.addDependencyList(getDependencyList()); 76 77 getBuilderProgram().configure(_message); 78 } 79 80 83 public EjbMessageBean getMessage() 84 { 85 return _message; 86 } 87 } 88 | Popular Tags |