1 23 24 package com.sun.enterprise.deployment.node.runtime; 25 26 import com.sun.enterprise.deployment.ApplicationClientDescriptor; 27 import com.sun.enterprise.deployment.node.DeploymentDescriptorNode; 28 import com.sun.enterprise.deployment.node.XMLNode; 29 import com.sun.enterprise.deployment.runtime.JavaWebStartAccessDescriptor; 30 import com.sun.enterprise.deployment.xml.RuntimeTagNames; 31 import com.sun.enterprise.deployment.xml.TagNames; 32 import java.util.Map ; 33 import org.w3c.dom.Node ; 34 35 39 public class JavaWebStartAccessNode extends DeploymentDescriptorNode { 40 41 protected JavaWebStartAccessDescriptor descriptor; 42 43 44 public JavaWebStartAccessNode() { 45 } 46 47 50 public Object getDescriptor() { 51 if (descriptor==null) { 52 descriptor = new JavaWebStartAccessDescriptor(); 53 XMLNode parentNode = getParentNode(); 54 if (parentNode != null && (parentNode instanceof AppClientRuntimeNode)) { 55 Object parentDescriptor = parentNode.getDescriptor(); 56 if (parentDescriptor != null && (parentDescriptor instanceof ApplicationClientDescriptor) ) { 57 ApplicationClientDescriptor acDescriptor = (ApplicationClientDescriptor) parentDescriptor; 58 acDescriptor.setJavaWebStartAccessDescriptor(descriptor); 59 } 60 61 } 62 } 63 return descriptor; 64 } 65 66 72 protected Map getDispatchTable() { 73 Map table = super.getDispatchTable(); 74 table.put(RuntimeTagNames.CONTEXT_ROOT, "setContextRoot"); 75 table.put(RuntimeTagNames.ELIGIBLE, "setEligible"); 76 table.put(RuntimeTagNames.VENDOR, "setVendor"); 77 return table; 78 } 79 80 88 public Node writeDescriptor(Node parent, String nodeName, JavaWebStartAccessDescriptor descr) { 89 Node accessNode = super.writeDescriptor(parent, nodeName, descr); 90 appendTextChild(accessNode, RuntimeTagNames.CONTEXT_ROOT, descr.getContextRoot()); 91 appendTextChild(accessNode, RuntimeTagNames.ELIGIBLE, Boolean.toString(descr.isEligible())); 92 appendTextChild(accessNode, RuntimeTagNames.VENDOR, descr.getVendor()); 93 94 return accessNode; 95 } 96 97 public static void writeJavaWebStartInfo(Node parent, JavaWebStartAccessDescriptor descr) { 98 if (descr != null) { 99 JavaWebStartAccessNode newNode = new JavaWebStartAccessNode(); 100 newNode.writeDescriptor(parent, RuntimeTagNames.JAVA_WEB_START_ACCESS, descr); 101 } 102 } 103 } 104 | Popular Tags |