1 16 package org.apache.axis.deployment.wsdd; 17 18 import org.apache.axis.ConfigurationException; 19 import org.apache.axis.EngineConfiguration; 20 import org.apache.axis.Handler; 21 import org.apache.axis.encoding.SerializationContext; 22 import org.apache.axis.utils.Messages; 23 import org.apache.axis.utils.XMLUtils; 24 import org.w3c.dom.Element ; 25 26 import javax.xml.namespace.QName ; 27 import java.io.IOException ; 28 import java.util.List ; 29 import java.util.ArrayList ; 30 31 32 37 public class WSDDGlobalConfiguration 38 extends WSDDDeployableItem 39 { 40 private WSDDRequestFlow requestFlow; 41 private WSDDResponseFlow responseFlow; 42 private ArrayList roles = new ArrayList (); 43 44 47 public WSDDGlobalConfiguration() 48 { 49 } 50 51 56 public WSDDGlobalConfiguration(Element e) 57 throws WSDDException 58 { 59 super(e); 60 Element reqEl = getChildElement(e, ELEM_WSDD_REQFLOW); 61 if (reqEl != null && reqEl.getElementsByTagName("*").getLength()>0) { 62 requestFlow = new WSDDRequestFlow(reqEl); 63 } 64 Element respEl = getChildElement(e, ELEM_WSDD_RESPFLOW); 65 if (respEl != null && respEl.getElementsByTagName("*").getLength()>0) { 66 responseFlow = new WSDDResponseFlow(respEl); 67 } 68 69 Element [] roleElements = getChildElements(e, ELEM_WSDD_ROLE); 70 for (int i = 0; i < roleElements.length; i++) { 71 String role = XMLUtils.getChildCharacterData(roleElements[i]); 72 roles.add(role); 73 } 74 } 75 76 protected QName getElementName() 77 { 78 return WSDDConstants.QNAME_GLOBAL; 79 } 80 81 84 public WSDDRequestFlow getRequestFlow() 85 { 86 return requestFlow; 87 } 88 89 92 public void setRequestFlow(WSDDRequestFlow reqFlow) 93 { 94 requestFlow = reqFlow; 95 } 96 97 100 public WSDDResponseFlow getResponseFlow() 101 { 102 return responseFlow; 103 } 104 105 108 public void setResponseFlow(WSDDResponseFlow responseFlow) { 109 this.responseFlow = responseFlow; 110 } 111 112 116 public WSDDFaultFlow[] getFaultFlows() 117 { 118 return null; 119 } 120 121 126 public WSDDFaultFlow getFaultFlow(QName name) 127 { 128 129 WSDDFaultFlow[] t = getFaultFlows(); 130 131 for (int n = 0; n < t.length; n++) { 132 if (t[n].getQName().equals(name)) { 133 return t[n]; 134 } 135 } 136 137 return null; 138 } 139 140 144 public QName getType() 145 { 146 return null; 147 } 148 149 153 public void setType(String type) throws WSDDException 154 { 155 throw new WSDDException(Messages.getMessage("noTypeOnGlobalConfig00")); 156 } 157 158 159 160 165 public Handler makeNewInstance(EngineConfiguration registry) 166 { 167 return null; 168 } 169 170 173 public void writeToContext(SerializationContext context) 174 throws IOException { 175 context.startElement(QNAME_GLOBAL, null); 176 writeParamsToContext(context); 177 if (requestFlow != null) 178 requestFlow.writeToContext(context); 179 if (responseFlow != null) 180 responseFlow.writeToContext(context); 181 context.endElement(); 182 } 183 184 public void deployToRegistry(WSDDDeployment registry) 185 throws ConfigurationException { 186 if (requestFlow != null) 187 requestFlow.deployToRegistry(registry); 188 if (responseFlow != null) 189 responseFlow.deployToRegistry(registry); 190 } 191 192 public List getRoles() { 193 return (List )roles.clone(); 194 } 195 } 196 197 | Popular Tags |