1 26 27 package org.objectweb.jonas_lib.deployment.xml; 28 29 33 public class Handler extends AbsElement { 34 35 38 private String handlerName = null; 39 40 43 private JLinkedList initParamList = null; 44 45 48 private JLinkedList soapHeaderList = null; 49 50 53 private JLinkedList soapRoleList = null; 54 55 58 private JLinkedList portNameList = null; 59 60 61 64 private String handlerClass = null; 65 66 69 public Handler() { 70 super(); 71 initParamList = new JLinkedList("init-param"); 72 soapHeaderList = new JLinkedList("soap-header"); 73 soapRoleList = new JLinkedList("soap-role"); 74 portNameList = new JLinkedList("port-name"); 75 } 76 77 78 80 84 public void setHandlerName(String handlerName) { 85 this.handlerName = handlerName; 86 } 87 88 92 public void addPortName(String portName) { 93 portNameList.add(portName); 94 } 95 96 97 101 public void addSoapRole(String soapRole) { 102 soapRoleList.add(soapRole); 103 } 104 105 109 public void addSoapHeader(Qname soapHeader) { 110 soapHeaderList.add(soapHeader); 111 } 112 113 117 public void addInitParam(InitParam initParam) { 118 initParamList.add(initParam); 119 } 120 121 125 public void setHandlerClass(String handlerClass) { 126 this.handlerClass = handlerClass; 127 } 128 129 131 134 public String getHandlerName() { 135 return handlerName; 136 } 137 138 141 public String getHandlerClass() { 142 return handlerClass; 143 } 144 145 148 public JLinkedList getInitParamList() { 149 return initParamList; 150 } 151 152 155 public JLinkedList getSoapHeaderList() { 156 return soapHeaderList; 157 } 158 159 162 public JLinkedList getSoapRoleList() { 163 return soapRoleList; 164 } 165 166 169 public JLinkedList getPortNameList() { 170 return portNameList; 171 } 172 173 178 public String toXML(int indent) { 179 StringBuffer sb = new StringBuffer (); 180 sb.append(indent(indent)); 181 sb.append("<handler>\n"); 182 183 indent += 2; 184 185 sb.append(xmlElement(handlerName, "handler-name", indent)); 187 188 sb.append(xmlElement(handlerClass, "handler-class", indent)); 190 191 sb.append(initParamList.toXML(indent)); 193 194 sb.append(soapHeaderList.toXML(indent)); 196 197 sb.append(soapRoleList.toXML(indent)); 199 200 sb.append(portNameList.toXML(indent)); 202 203 indent -= 2; 204 sb.append(indent(indent)); 205 sb.append("</handler>\n"); 206 207 return sb.toString(); 208 } 209 210 211 } 212 | Popular Tags |