FileDocCategorySizeDatePackage
PMDescriptorsNode.javaAPI DocGlassfish v2 API4155Fri May 04 22:31:42 BST 2007com.sun.enterprise.deployment.node.runtime

PMDescriptorsNode

public class PMDescriptorsNode extends RuntimeDescriptorNode
This node handles the pm-descriptors runtime xml element
author
Jerome Dochez
version

Fields Summary
Constructors Summary
public PMDescriptorsNode()
Creates new CmpNode

        registerElementHandler(new XMLElement(RuntimeTagNames.PM_DESCRIPTOR), 
                               PMDescriptorNode.class, "addPersistenceManager");
        registerElementHandler(new XMLElement(RuntimeTagNames.PM_INUSE), 
                               PMInUseNode.class, "setPersistenceManagerInUse");        
    
Methods Summary
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.EjbBundleDescriptor descriptor)
write the descriptor class to a DOM tree and return it

param
parent node for the DOM tree
param
node name
param
the descriptor to write
return
the DOM tree top node

		
	Node pms = null;
	Vector pmDescriptors = descriptor.getPersistenceManagers();
	if (pmDescriptors!=null && !pmDescriptors.isEmpty()) {
            pms = super.writeDescriptor(parent, nodeName, descriptor);
            PMDescriptorNode pmNode = new PMDescriptorNode();
            
            for (Iterator pmIterator = pmDescriptors.iterator();pmIterator.hasNext();) {
                IASPersistenceManagerDescriptor pmDescriptor = (IASPersistenceManagerDescriptor) pmIterator.next();
                pmNode.writeDescriptor(pms, RuntimeTagNames.PM_DESCRIPTOR, pmDescriptor);
            }
            PersistenceManagerInUse inUse = descriptor.getPersistenceManagerInUse();
            if (inUse!=null) {
		PMInUseNode inUseNode = new PMInUseNode();
		inUseNode.writeDescriptor(pms, RuntimeTagNames.PM_INUSE, inUse);
            }
        }
	return pms;