1 19 20 21 package org.netbeans.tests.j2eeserver.plugin.jsr88; 22 23 import javax.enterprise.deploy.spi.exceptions.*; 24 import javax.enterprise.deploy.spi.*; 25 import java.beans.*; 26 import javax.enterprise.deploy.model.*; 27 28 import java.util.*; 29 30 34 public class EjbConfigBean implements DConfigBean { 35 36 DDBean bean; 37 EjbModuleConfigBean module; 38 DepConfig config; 39 Collection children = new HashSet(); 40 String EJBREF = "ejb-ref"; 41 String EJBLOCALREF = "ejb-local-ref"; 42 String RESOURCEREF = "resource-ref"; 43 44 public EjbConfigBean(DDBean bean, EjbModuleConfigBean module, DepConfig config) { 45 this.bean = bean; this.config = config; this.module = module; 46 this.ejbName = bean.getChildBean("ejb-name")[0].getText(); 47 } 48 49 public DConfigBean getDConfigBean(DDBean dDBean) throws ConfigurationException { 50 DConfigBean ret = null; 51 if(dDBean.getXpath().endsWith(EJBREF) || dDBean.getXpath().endsWith(EJBLOCALREF)) 52 ret = new EjbRefConfigBean(dDBean, config); 53 else if (dDBean.getXpath().endsWith(RESOURCEREF)) 54 ret = new ResourceRefConfigBean(dDBean, module, config); 55 if(ret != null) children.add(ret); 56 return ret; 57 } 58 59 public DDBean getDDBean() { 60 return bean; 61 } 62 63 public String [] getXpaths() { 64 return new String [] { EJBREF, EJBLOCALREF, RESOURCEREF }; 65 } 66 67 public void notifyDDChange(XpathEvent xpathEvent) { 68 } 69 70 public void removeDConfigBean(DConfigBean dConfigBean) throws BeanNotFoundException { 71 children.remove(dConfigBean); 72 propertyChangeSupport.firePropertyChange(dConfigBean.getClass().toString(),dConfigBean,null); 73 } 74 75 76 private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); 77 78 79 private String jndiName; 80 81 82 private String configurationName; 83 84 85 private String securityProxy; 86 87 88 private String ejbName; 89 90 public void addPropertyChangeListener(PropertyChangeListener listener) { 91 propertyChangeSupport.addPropertyChangeListener(listener); 92 } 93 94 public void removePropertyChangeListener(PropertyChangeListener listener) { 95 propertyChangeSupport.removePropertyChangeListener(listener); 96 } 97 98 101 public String getJndiName() { 102 return this.jndiName; 103 } 104 105 108 public void setJndiName(String jndiName) { 109 String oldJndiName = this.jndiName; 110 this.jndiName = jndiName; 111 propertyChangeSupport.firePropertyChange("jndiName", oldJndiName, jndiName); 112 } 113 114 117 public String getConfigurationName() { 118 return this.configurationName; 119 } 120 121 124 public void setConfigurationName(String configurationName) { 125 String oldConfigurationName = this.configurationName; 126 this.configurationName = configurationName; 127 propertyChangeSupport.firePropertyChange("configurationName", oldConfigurationName, configurationName); 128 } 129 130 133 public String getSecurityProxy() { 134 return this.securityProxy; 135 } 136 137 140 public void setSecurityProxy(String securityProxy) { 141 String oldSecurityProxy = this.securityProxy; 142 this.securityProxy = securityProxy; 143 propertyChangeSupport.firePropertyChange("securityProxy", oldSecurityProxy, securityProxy); 144 } 145 146 149 public String getEjbName() { 150 return this.ejbName; 151 } 152 153 } 154 | Popular Tags |