1 23 24 package com.sun.enterprise.deployment.node.runtime.web; 25 26 import org.w3c.dom.Node ; 27 import org.w3c.dom.Element ; 28 29 import com.sun.enterprise.deployment.xml.RuntimeTagNames; 30 import com.sun.enterprise.deployment.node.XMLElement; 31 import com.sun.enterprise.deployment.runtime.web.IdempotentUrlPattern; 32 33 34 35 38 public class IdempotentUrlPatternNode extends WebRuntimeNode { 39 40 IdempotentUrlPattern descriptor = null; 41 42 45 public Object getDescriptor() { 46 if (descriptor == null) { 47 descriptor = new IdempotentUrlPattern(); 48 } 49 return descriptor; 50 } 51 52 60 protected boolean setAttributeValue(XMLElement elementName, XMLElement attributeName, String value) { 61 if (attributeName.getQName().equals(RuntimeTagNames.URL_PATTERN)) { 62 descriptor.setAttributeValue(IdempotentUrlPattern.URL_PATTERN, 63 value); 64 return true; 65 } else if (attributeName.getQName().equals( 66 RuntimeTagNames.NUM_OF_RETRIES)) { 67 descriptor.setAttributeValue(IdempotentUrlPattern.NUM_OF_RETRIES, 68 value); 69 return true; 70 } 71 return false; 72 } 73 74 82 public Node writeDescriptor(Node parent, String nodeName, 83 IdempotentUrlPattern pattern) { 84 Element patternNode = 85 (Element )super.writeDescriptor(parent, nodeName, pattern); 86 87 if (pattern.getAttributeValue(pattern.URL_PATTERN) != null) { 89 setAttribute(patternNode, RuntimeTagNames.URL_PATTERN, pattern.getAttributeValue(pattern.URL_PATTERN)); 90 } 91 92 if (pattern.getAttributeValue(pattern.NUM_OF_RETRIES) != null) { 94 setAttribute(patternNode, RuntimeTagNames.NUM_OF_RETRIES, pattern.getAttributeValue(pattern.NUM_OF_RETRIES)); 95 } 96 97 return patternNode; 98 } 99 } 100 101 | Popular Tags |