1 23 24 29 30 package com.sun.enterprise.deployment.node.ejb; 31 32 import java.util.Map ; 33 import java.util.HashMap ; 34 import java.util.Iterator ; 35 import org.w3c.dom.Node ; 36 37 import com.sun.enterprise.deployment.node.XMLElement; 38 import com.sun.enterprise.deployment.node.DeploymentDescriptorNode; 39 40 import com.sun.enterprise.deployment.Descriptor; 41 import com.sun.enterprise.deployment.EjbBundleDescriptor; 42 import com.sun.enterprise.deployment.RelationshipDescriptor; 43 import com.sun.enterprise.deployment.xml.EjbTagNames; 44 45 51 public class RelationshipsNode extends DeploymentDescriptorNode { 52 53 public RelationshipsNode() { 54 super(); 55 registerElementHandler(new XMLElement(EjbTagNames.EJB_RELATION), 56 EjbRelationNode.class); 57 } 58 59 62 public Object getDescriptor() { 63 return getParentNode().getDescriptor(); 64 } 65 66 67 73 public boolean endElement(XMLElement element) { 74 return element.equals(getXMLRootTag()); 75 } 76 77 83 protected Map getDispatchTable() { 84 Map table = new HashMap (); 86 table.put(EjbTagNames.DESCRIPTION, "setRelationshipsDescription"); 87 return table; 88 } 89 90 98 public Node writeDescriptor(Node parent, String nodeName, EjbBundleDescriptor descriptor) { 99 Node relationshipsNode = super.writeDescriptor(parent, nodeName, descriptor); 100 appendTextChild(relationshipsNode, EjbTagNames.DESCRIPTION, descriptor.getRelationshipsDescription()); 101 EjbRelationNode subNode = new EjbRelationNode(); 102 for (Iterator e=descriptor.getRelationships().iterator();e.hasNext();) { 103 RelationshipDescriptor rd = (RelationshipDescriptor) e.next(); 104 subNode.writeDescriptor(relationshipsNode, EjbTagNames.EJB_RELATION, rd); 105 } 106 107 return relationshipsNode; 108 } 109 } | Popular Tags |