1 23 24 package com.sun.enterprise.deployment.node; 25 26 import java.util.Map ; 27 import org.w3c.dom.Node ; 28 29 import com.sun.enterprise.deployment.JmsDestinationReferenceDescriptor; 30 import com.sun.enterprise.deployment.InjectionTarget; 31 import com.sun.enterprise.deployment.xml.TagNames; 32 import com.sun.enterprise.deployment.Descriptor; 33 import com.sun.enterprise.deployment.node.LocalizedNode; 34 35 42 public class ResourceEnvRefNode extends DeploymentDescriptorNode { 43 44 45 public ResourceEnvRefNode() { 46 super(); 47 registerElementHandler(new XMLElement(TagNames.INJECTION_TARGET), 48 InjectionTargetNode.class, "addInjectionTarget"); 49 } 50 51 57 protected Map getDispatchTable() { 58 Map table = super.getDispatchTable(); 59 table.put(TagNames.RESOURCE_ENV_REFERENCE_NAME, "setName"); 60 table.put(TagNames.RESOURCE_ENV_REFERENCE_TYPE, "setRefType"); 61 table.put(TagNames.MAPPED_NAME, "setMappedName"); 62 return table; 63 } 64 65 73 public Node writeDescriptor(Node parent, String nodeName, JmsDestinationReferenceDescriptor descriptor) { 74 Node ejbResNode = appendChild(parent, nodeName); 75 76 writeLocalizedDescriptions(ejbResNode,descriptor); 77 78 appendTextChild(ejbResNode, TagNames.RESOURCE_ENV_REFERENCE_NAME, descriptor.getName()); 79 appendTextChild(ejbResNode, TagNames.RESOURCE_ENV_REFERENCE_TYPE, descriptor.getRefType()); 80 appendTextChild(ejbResNode, TagNames.MAPPED_NAME, descriptor.getMappedName()); 81 82 if( descriptor.isInjectable() ) { 83 InjectionTargetNode ijNode = new InjectionTargetNode(); 84 for (InjectionTarget target : descriptor.getInjectionTargets()) { 85 ijNode.writeDescriptor(ejbResNode, TagNames.INJECTION_TARGET, target); 86 } 87 } 88 89 return ejbResNode; 90 } 91 } 92 | Popular Tags |