1 23 24 25 package com.sun.enterprise.deployment.io; 26 27 import com.sun.enterprise.deployment.node.RootXMLNode; 28 import com.sun.enterprise.deployment.node.PersistenceNode; 29 import com.sun.enterprise.deployment.*; 30 31 34 public class PersistenceDeploymentDescriptorFile extends DeploymentDescriptorFile { 35 public String getDeploymentDescriptorPath() { 36 return DescriptorConstants.PERSISTENCE_DD_ENTRY; 37 } 38 39 public RootXMLNode getRootXMLNode(Descriptor descriptor) { 40 if(descriptor==null || 45 descriptor instanceof Application || 46 descriptor instanceof ApplicationClientDescriptor || 47 descriptor instanceof EjbBundleDescriptor || 48 descriptor instanceof WebBundleDescriptor) { 49 return new PersistenceNode(new PersistenceUnitsDescriptor()); 50 } else { 51 throw new IllegalArgumentException (descriptor.getClass().getName()+ 52 "is not allowed to contain persistence.xml file"); 53 } 54 } 55 56 63 @Override protected String getDefaultSchemaSource() { 64 PersistenceNode rootXMLNode = 67 PersistenceNode.class.cast(getRootXMLNode(null)); 68 return rootXMLNode.getNameSpace() + " " + rootXMLNode.getSystemID(); 69 } 70 } 71 | Popular Tags |