1 26 27 package org.objectweb.jonas_lib.deployment.xml; 28 29 33 public class ServiceRef extends AbsElement { 34 35 38 private String serviceRefName = null; 39 40 41 44 private String serviceInterface = null; 45 46 49 private String jaxrpcMappingFile = null; 50 51 54 private String wsdlFile = null; 55 56 57 60 private Qname serviceQname = null; 61 62 65 private JLinkedList portComponentRefList = null; 66 67 68 71 private JLinkedList handlerList = null; 72 73 74 77 public ServiceRef() { 78 super(); 79 portComponentRefList = new JLinkedList("port-component-ref"); 80 handlerList = new JLinkedList("handler"); 81 } 82 83 84 86 90 public void addPortComponentRef(PortComponentRef portComponentRef) { 91 portComponentRefList.add(portComponentRef); 92 } 93 94 98 public void addHandler(Handler handler) { 99 handlerList.add(handler); 100 } 101 102 106 public void setServiceRefName(String serviceRefName) { 107 this.serviceRefName = serviceRefName; 108 } 109 110 111 115 public void setServiceInterface(String serviceInterface) { 116 this.serviceInterface = serviceInterface; 117 } 118 119 120 124 public void setJaxrpcMappingFile(String jaxrpcMappingFile) { 125 this.jaxrpcMappingFile = jaxrpcMappingFile; 126 } 127 128 129 133 public void setWsdlFile(String wsdlFile) { 134 this.wsdlFile = wsdlFile; 135 } 136 137 138 142 public void setServiceQname(Qname serviceQname) { 143 this.serviceQname = serviceQname; 144 } 145 146 148 151 public String getServiceRefName() { 152 return serviceRefName; 153 } 154 155 158 public String getServiceInterface() { 159 return serviceInterface; 160 } 161 162 165 public String getJaxrpcMappingFile() { 166 return jaxrpcMappingFile; 167 } 168 169 172 public String getWsdlFile() { 173 return wsdlFile; 174 } 175 176 177 180 public Qname getServiceQname() { 181 return serviceQname; 182 } 183 184 187 public JLinkedList getHandlerList() { 188 return handlerList; 189 } 190 191 194 public JLinkedList getPortComponentRefList() { 195 return portComponentRefList; 196 } 197 198 203 public String toXML(int indent) { 204 StringBuffer sb = new StringBuffer (); 205 sb.append(indent(indent)); 206 sb.append("<service-ref>\n"); 207 208 indent += 2; 209 210 sb.append(xmlElement(serviceRefName, "service-ref-name", indent)); 212 213 sb.append(xmlElement(serviceInterface, "service-interface", indent)); 215 216 sb.append(xmlElement(wsdlFile, "wsdl-file", indent)); 218 219 sb.append(xmlElement(jaxrpcMappingFile, "jaxrpc-mapping-file", indent)); 221 222 if (serviceQname != null) { 224 sb.append(serviceQname.toXML(indent)); 225 } 226 227 sb.append(portComponentRefList.toXML(indent)); 229 230 sb.append(handlerList.toXML(indent)); 232 233 indent -= 2; 234 sb.append(indent(indent)); 235 sb.append("</service-ref>\n"); 236 237 return sb.toString(); 238 } 239 240 241 } 242 | Popular Tags |