1 23 package com.sun.enterprise.deployment.node.runtime; 24 25 import java.util.Vector ; 26 import java.util.Iterator ; 27 import org.w3c.dom.Node ; 28 29 import com.sun.enterprise.deployment.node.XMLElement; 30 import com.sun.enterprise.deployment.EjbBundleDescriptor; 31 import com.sun.enterprise.deployment.runtime.IASPersistenceManagerDescriptor; 32 import com.sun.enterprise.deployment.runtime.PersistenceManagerInUse; 33 import com.sun.enterprise.deployment.xml.RuntimeTagNames; 34 35 41 42 public class PMDescriptorsNode extends RuntimeDescriptorNode { 43 44 45 public PMDescriptorsNode() { 46 registerElementHandler(new XMLElement(RuntimeTagNames.PM_DESCRIPTOR), 47 PMDescriptorNode.class, "addPersistenceManager"); 48 registerElementHandler(new XMLElement(RuntimeTagNames.PM_INUSE), 49 PMInUseNode.class, "setPersistenceManagerInUse"); 50 } 51 52 60 public Node writeDescriptor(Node parent, String nodeName, EjbBundleDescriptor descriptor) { 61 62 Node pms = null; 63 Vector pmDescriptors = descriptor.getPersistenceManagers(); 64 if (pmDescriptors!=null && !pmDescriptors.isEmpty()) { 65 pms = super.writeDescriptor(parent, nodeName, descriptor); 66 PMDescriptorNode pmNode = new PMDescriptorNode(); 67 68 for (Iterator pmIterator = pmDescriptors.iterator();pmIterator.hasNext();) { 69 IASPersistenceManagerDescriptor pmDescriptor = (IASPersistenceManagerDescriptor) pmIterator.next(); 70 pmNode.writeDescriptor(pms, RuntimeTagNames.PM_DESCRIPTOR, pmDescriptor); 71 } 72 PersistenceManagerInUse inUse = descriptor.getPersistenceManagerInUse(); 73 if (inUse!=null) { 74 PMInUseNode inUseNode = new PMInUseNode(); 75 inUseNode.writeDescriptor(pms, RuntimeTagNames.PM_INUSE, inUse); 76 } 77 } 78 return pms; 79 } 80 } 81 | Popular Tags |