Search in sources :

Example 1 with PersistenceManagerInUse

use of org.glassfish.ejb.deployment.descriptor.runtime.PersistenceManagerInUse in project Payara by payara.

the class PMDescriptorsNode method writeDescriptor.

/**
 * 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
 */
public Node writeDescriptor(Node parent, String nodeName, EjbBundleDescriptorImpl descriptor) {
    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;
}
Also used : IASPersistenceManagerDescriptor(org.glassfish.ejb.deployment.descriptor.runtime.IASPersistenceManagerDescriptor) Node(org.w3c.dom.Node) RuntimeDescriptorNode(com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode) PersistenceManagerInUse(org.glassfish.ejb.deployment.descriptor.runtime.PersistenceManagerInUse) Iterator(java.util.Iterator) Vector(java.util.Vector)

Aggregations

RuntimeDescriptorNode (com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode)1 Iterator (java.util.Iterator)1 Vector (java.util.Vector)1 IASPersistenceManagerDescriptor (org.glassfish.ejb.deployment.descriptor.runtime.IASPersistenceManagerDescriptor)1 PersistenceManagerInUse (org.glassfish.ejb.deployment.descriptor.runtime.PersistenceManagerInUse)1 Node (org.w3c.dom.Node)1