1 19 20 package org.netbeans.modules.j2ee.sun.share.configbean; 21 22 import javax.enterprise.deploy.spi.DConfigBean ; 23 import javax.enterprise.deploy.spi.DeploymentConfiguration ; 24 import javax.enterprise.deploy.spi.exceptions.ConfigurationException ; 25 import javax.enterprise.deploy.model.DDBean ; 26 import javax.enterprise.deploy.model.DDBeanRoot ; 27 import javax.enterprise.deploy.model.DeployableObject ; 28 import javax.enterprise.deploy.model.J2eeApplicationObject ; 29 30 41 public class EntityEjbDCBFactory extends AbstractDCBFactory { 43 static final String PERSISTENCE_TYPE_KEY = "persistence-type"; static final String CONTAINER = "Container"; static final String BEAN = "Bean"; 47 private EjbJarRoot parent; 48 49 53 public EntityEjbDCBFactory(EjbJarRoot parent) { 54 this.parent = parent; 55 } 56 57 protected Class getClass(DDBean ddBean, Base dcbParent) throws ConfigurationException { 58 Class dcbClass; 59 String testRet[] = ddBean.getText(PERSISTENCE_TYPE_KEY); 60 61 if(null != testRet && 1 == testRet.length && testRet[0].indexOf(CONTAINER) > -1) { 62 dcbClass = CmpEntityEjb.class; 63 64 parent.addCmpResourceIfNotPresent(); 72 80 } else if(null != testRet && 1 == testRet.length && testRet[0].indexOf(BEAN) > -1) { 81 dcbClass = EntityEjb.class; 82 } else { 83 throw Utils.makeCE("ERR_UnknownPersistenceType", testRet, null); 84 } 85 86 return dcbClass; 87 } 88 89 119 } 120 | Popular Tags |