1 23 24 29 30 package com.sun.enterprise.deployment.node; 31 32 import java.util.Map ; 33 import org.w3c.dom.Node ; 34 35 import com.sun.enterprise.deployment.Descriptor; 36 import com.sun.enterprise.deployment.RoleReference; 37 import com.sun.enterprise.deployment.xml.EjbTagNames; 38 39 45 public class SecurityRoleRefNode extends DeploymentDescriptorNode { 46 47 53 protected Map getDispatchTable() { 54 Map table = super.getDispatchTable(); 56 table.put(EjbTagNames.ROLE_NAME, "setName"); 57 table.put(EjbTagNames.ROLE_LINK, "setValue"); 58 return table; 59 } 60 61 69 public Node writeDescriptor(Node parent, String nodeName, Descriptor descriptor) { 70 if (! (descriptor instanceof RoleReference)) { 71 throw new IllegalArgumentException (getClass() + " cannot handles descriptors of type " + descriptor.getClass()); 72 } 73 RoleReference roleRef = (RoleReference) descriptor; 74 Node subNode = super.writeDescriptor(parent, nodeName, roleRef); 75 76 writeLocalizedDescriptions(subNode, descriptor); 77 78 appendTextChild(subNode, EjbTagNames.ROLE_NAME, roleRef.getName()); 79 appendTextChild(subNode, EjbTagNames.ROLE_LINK, roleRef.getValue()); 80 return subNode; 81 } 82 } 83 | Popular Tags |