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.MessageDestinationReferenceDescriptor; 30 import com.sun.enterprise.deployment.InjectionTarget; 31 import com.sun.enterprise.deployment.node.LocalizedNode; 32 import com.sun.enterprise.deployment.xml.TagNames; 33 import com.sun.enterprise.deployment.Descriptor; 34 35 42 public class MessageDestinationRefNode extends DeploymentDescriptorNode { 43 44 public MessageDestinationRefNode() { 45 super(); 46 registerElementHandler(new XMLElement(TagNames.INJECTION_TARGET), 47 InjectionTargetNode.class, "addInjectionTarget"); 48 } 49 50 57 protected Map getDispatchTable() { 58 Map table = super.getDispatchTable(); 59 table.put(TagNames.MESSAGE_DESTINATION_REFERENCE_NAME, "setName"); 60 table.put(TagNames.MESSAGE_DESTINATION_TYPE, "setDestinationType"); 61 table.put(TagNames.MESSAGE_DESTINATION_USAGE, "setUsage"); 62 table.put(TagNames.MESSAGE_DESTINATION_LINK, 63 "setMessageDestinationLinkName"); 64 table.put(TagNames.MAPPED_NAME, "setMappedName"); 65 66 return table; 67 } 68 69 77 public Node writeDescriptor(Node parent, String nodeName, 78 MessageDestinationReferenceDescriptor desc) { 79 80 Node msgDestRefNode = appendChild(parent, nodeName); 81 82 writeLocalizedDescriptions(msgDestRefNode, desc); 83 84 appendTextChild(msgDestRefNode, 85 TagNames.MESSAGE_DESTINATION_REFERENCE_NAME, 86 desc.getName()); 87 appendTextChild(msgDestRefNode, TagNames.MESSAGE_DESTINATION_TYPE, 88 desc.getDestinationType()); 89 appendTextChild(msgDestRefNode, TagNames.MESSAGE_DESTINATION_USAGE, 90 desc.getUsage()); 91 appendTextChild(msgDestRefNode, TagNames.MESSAGE_DESTINATION_LINK, 92 desc.getMessageDestinationLinkName()); 93 appendTextChild(msgDestRefNode, TagNames.MAPPED_NAME, 94 desc.getMappedName()); 95 96 if( desc.isInjectable() ) { 97 InjectionTargetNode ijNode = new InjectionTargetNode(); 98 for (InjectionTarget target : desc.getInjectionTargets()) { 99 ijNode.writeDescriptor(msgDestRefNode, TagNames.INJECTION_TARGET, target); 100 } 101 } 102 103 return msgDestRefNode; 104 } 105 } 106 | Popular Tags |