1 23 24 package com.sun.enterprise.deployment.node.connector; 25 26 import java.util.*; 27 import org.xml.sax.Attributes ; 28 import com.sun.enterprise.deployment.Descriptor; 29 import com.sun.enterprise.deployment.ConnectorDescriptor; 30 import com.sun.enterprise.deployment.OutboundResourceAdapter; 31 import com.sun.enterprise.deployment.MessageListener; 32 import com.sun.enterprise.deployment.EnvironmentProperty; 33 import com.sun.enterprise.deployment.xml.ConnectorTagNames; 34 import com.sun.enterprise.deployment.xml.TagNames; 35 import com.sun.enterprise.deployment.node.DescriptorFactory; 36 import com.sun.enterprise.deployment.node.DeploymentDescriptorNode; 37 import com.sun.enterprise.deployment.node.ConfigurableNode; 38 import com.sun.enterprise.deployment.node.XMLElement; 39 40 import org.xml.sax.Attributes ; 41 import org.w3c.dom.Node ; 42 43 49 public class RequiredConfigNode extends DeploymentDescriptorNode { 50 51 private EnvironmentProperty config = null; 52 53 59 protected Map getDispatchTable() { 60 Map table = super.getDispatchTable(); 61 table.put(ConnectorTagNames.CONFIG_PROPERTY_NAME, "setName"); 62 return table; 63 } 64 65 68 public Object getDescriptor() { 69 if (config == null) { 70 config = (EnvironmentProperty) DescriptorFactory.getDescriptor(getXMLPath()); 71 } 72 return config; 73 } 74 75 82 public Node writeDescriptor(Node parent, Descriptor descriptor) { 83 84 if (! (descriptor instanceof MessageListener)) { 85 throw new IllegalArgumentException (getClass() + " cannot handle descriptors of type " + descriptor.getClass()); 86 } 87 Iterator configProps = null; 88 if (descriptor instanceof MessageListener) { 89 configProps = ((MessageListener)descriptor).getConfigProperties().iterator(); 90 } 91 92 for (;configProps.hasNext();) { 94 EnvironmentProperty config = (EnvironmentProperty) configProps.next(); 95 Node configNode = appendChild(parent, ConnectorTagNames.REQUIRED_CONFIG_PROP); 96 writeLocalizedDescriptions(configNode, config); 97 appendTextChild(configNode, ConnectorTagNames.CONFIG_PROPERTY_NAME, config.getName()); 98 } 99 return parent; 100 } 101 } 102 | Popular Tags |