1 22 package org.jboss.deployment.spi.beans; 23 24 import javax.enterprise.deploy.model.DDBean ; 25 import javax.enterprise.deploy.model.DDBeanRoot ; 26 import javax.enterprise.deploy.model.DeployableObject ; 27 import javax.enterprise.deploy.spi.DConfigBean ; 28 import javax.enterprise.deploy.spi.DConfigBeanRoot ; 29 import javax.enterprise.deploy.spi.exceptions.ConfigurationException ; 30 31 49 50 public class JBossExample1ConfigBeanRoot extends JBossConfigBeanProxy implements DConfigBeanRoot 51 { 52 53 public JBossExample1ConfigBeanRoot(DDBeanRoot root) 54 { 55 JBossExample1MainConfigBean bean = new JBossExample1MainConfigBean(root, this, null); 56 DeployableObject deployment = root.getDeployableObject(); 57 setBean(bean, deployment); 58 } 59 60 public DConfigBean getDConfigBean(DDBeanRoot arg0) 61 { 62 69 return null; 70 } 71 72 private class JBossExample1MainConfigBean extends AbstractJBossConfigBean 73 { 74 public JBossExample1MainConfigBean(DDBean bean, DConfigBeanRoot root, ConfigBeanXPaths path) 75 { 76 super(bean, root, path); 77 } 78 79 87 protected ConfigBeanXPaths buildXPathList() 88 { 89 ConfigBeanXPaths pathRoot = new ConfigBeanXPaths("", null); 90 91 new ConfigBeanXPaths("root-element/sub-element[@id]", pathRoot); 93 new ConfigBeanXPaths("root-element/sub-element/name", pathRoot); 94 new ConfigBeanXPaths("root-element/sub-element/class", pathRoot); 95 new ConfigBeanXPaths("root-element/other-sub/name", pathRoot); 96 new ConfigBeanXPaths("root-element/other-sub/description", pathRoot); 97 98 return pathRoot; 99 } 100 101 public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException 102 { 103 String path = bean.getXpath(); 105 ConfigBeanXPaths cPath = (ConfigBeanXPaths)xpaths.get(path); 106 if (cPath == null) 107 { 108 throw new ConfigurationException ("Config Bean Not Found"); 109 } 110 111 AbstractJBossConfigBean retBean = new JBossNullConfigBean(bean, this.myRoot, cPath); 112 children.add(retBean); 113 return retBean; 114 } 115 } 116 117 } 118 | Popular Tags |