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 WebModuleConfigBean implements DConfigBeanRoot { 35 36 DDBean bean; 37 DepConfig config; 38 Collection children = new HashSet(); 39 String WEBAPP = "/"; 40 String EJBREF = "web-app/ejb-ref"; 41 String RESOURCEREF = "web-app/resource-ref/res-ref-name"; 42 43 public WebModuleConfigBean(DDBean bean, DepConfig config) { 44 this.bean = bean; this.config = config; 45 } 46 47 public DConfigBean getDConfigBean(DDBean dDBean) throws ConfigurationException { 48 DConfigBean ret = null; 49 if(dDBean.getXpath().endsWith(EJBREF)) 50 ret = new EjbRefConfigBean(dDBean, config); 51 else if(dDBean.getXpath().endsWith(RESOURCEREF)) 52 ret = new ResourceRefConfigBean(dDBean, config); 53 else if (dDBean.getXpath().endsWith(WEBAPP)) 54 ret = this; 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 [] { RESOURCEREF, EJBREF }; 66 } 67 68 public void notifyDDChange(XpathEvent xpathEvent) { 69 } 70 71 public void removeDConfigBean(DConfigBean dConfigBean) throws BeanNotFoundException { 72 children.remove(dConfigBean); 73 propertyChangeSupport.firePropertyChange(dConfigBean.getClass().toString(),dConfigBean,null); 74 } 75 76 77 private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); 78 79 80 private String securityDomain; 81 82 83 private String contextRoot; 84 85 public void addPropertyChangeListener(PropertyChangeListener listener) { 86 propertyChangeSupport.addPropertyChangeListener(listener); 87 } 88 89 public void removePropertyChangeListener(PropertyChangeListener listener) { 90 propertyChangeSupport.removePropertyChangeListener(listener); 91 } 92 93 96 public String getSecurityDomain() { 97 return this.securityDomain; 98 } 99 100 103 public void setSecurityDomain(String securityDomain) { 104 String oldSecurityDomain = this.securityDomain; 105 this.securityDomain = securityDomain; 106 propertyChangeSupport.firePropertyChange("securityDomain", oldSecurityDomain, securityDomain); 107 } 108 109 113 public String getContextRoot() { 114 return this.contextRoot; 115 } 116 117 121 public void setContextRoot(String contextRoot) { 122 this.contextRoot = contextRoot; 123 } 124 125 public DConfigBean getDConfigBean(DDBeanRoot dDBeanRoot) { 126 return null; 127 } 128 129 } 130 | Popular Tags |