1 23 package com.sun.enterprise.deployment.node.runtime.connector; 24 25 import java.util.Map ; 26 import org.w3c.dom.Node ; 27 import org.w3c.dom.Element ; 28 29 import com.sun.enterprise.deployment.node.XMLElement; 30 import com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode; 31 import com.sun.enterprise.deployment.runtime.connector.RoleMap; 32 import com.sun.enterprise.deployment.runtime.connector.MapElement; 33 import com.sun.enterprise.deployment.xml.RuntimeTagNames; 34 35 41 public class RoleMapNode extends RuntimeDescriptorNode { 42 43 44 public RoleMapNode() { 45 registerElementHandler(new XMLElement(RuntimeTagNames.MAP_ELEMENT), 46 MapElementNode.class, "addMapElement"); 47 } 48 49 57 public Node writeDescriptor(Node parent, String nodeName, RoleMap descriptor) { 58 Element roleMapNode = (Element ) super.writeDescriptor(parent, nodeName, descriptor); 59 appendTextChild(roleMapNode, RuntimeTagNames.DESCRIPTION, descriptor.getDescription()); 60 setAttribute(roleMapNode, RuntimeTagNames.MAP_ID, (String ) descriptor.getValue(RoleMap.MAP_ID)); 61 62 MapElement[] maps = descriptor.getMapElement(); 64 if (maps.length>0) { 65 MapElementNode men = new MapElementNode(); 66 for (int i=0;i<maps.length;i++) { 67 men.writeDescriptor(roleMapNode, RuntimeTagNames.MAP_ELEMENT, maps[i]); 68 } 69 } 70 71 return roleMapNode; 72 } 73 } 74 | Popular Tags |