00001 00025 package org.objectweb.jonas_ws.wsgen.ddmodifier; 00026 00027 import org.w3c.dom.Document; 00028 import org.w3c.dom.Element; 00029 00030 import org.objectweb.jonas_lib.genbase.utils.XMLUtils; 00031 00032 00038 public class WsClientDDModifier extends DeploymentDescModifier { 00039 00043 private static final String JONAS_INIT_PARAM = "jonas-init-param"; 00044 00048 private static final String PARAM_NAME = "param-name"; 00049 00053 private static final String PARAM_VALUE = "param-value"; 00054 00062 public WsClientDDModifier(String name, Document doc, Element base) { 00063 super(XMLUtils.getJonasServiceRef(base, name), doc, base); 00064 } 00065 00071 public void addJonasInitParam(String name, String value) { 00072 Element jip = newJOnASElement(JONAS_INIT_PARAM); 00073 Element pn = newJOnASElement(PARAM_NAME, name); 00074 Element pv = newJOnASElement(PARAM_VALUE, value); 00075 00076 jip.appendChild(pn); 00077 jip.appendChild(pv); 00078 00079 getElement().appendChild(jip); 00080 } 00081 00086 public boolean hasJonasServiceRef() { 00087 return (getElement() != null); 00088 } 00089 00094 public Element createJonasServiceRef(String serviceRefName) { 00095 Element jsr = newJOnASElement("jonas-service-ref"); 00096 Element srn = newJ2EEElement("service-ref-name", serviceRefName); 00097 00098 jsr.appendChild(srn); 00099 return jsr; 00100 } 00101 00102 }