1 23 package com.sun.enterprise.deployment; 24 25 import java.util.Collection ; 26 import java.util.Iterator ; 27 import java.util.HashSet ; 28 29 import javax.xml.namespace.QName ; 30 31 import com.sun.enterprise.deployment.Descriptor; 32 import com.sun.enterprise.deployment.NameValuePairDescriptor; 33 34 40 public class WebServiceHandler extends Descriptor { 41 42 private String handlerName = null; 43 44 private String handlerClass = null; 45 46 private Collection initParams = new HashSet (); 47 48 private Collection soapHeaders = new HashSet (); 49 50 private Collection soapRoles = new HashSet (); 51 52 private Collection portNames = new HashSet (); 53 54 57 public WebServiceHandler(WebServiceHandler other) { 58 super(other); 59 handlerName = other.handlerName; handlerClass = other.handlerClass; portNames.addAll(other.portNames); soapRoles.addAll(other.soapRoles); soapHeaders.addAll(other.soapHeaders); for (Iterator i = other.initParams.iterator(); i.hasNext();) { 65 initParams.add(new NameValuePairDescriptor((NameValuePairDescriptor)i.next())); 66 } 67 } 68 69 public WebServiceHandler() { 70 } 71 72 76 public void setHandlerClass(String className) { 77 handlerClass = className; 78 super.changed(); 79 } 80 81 84 public String getHandlerClass() { 85 return handlerClass; 86 } 87 88 public void setHandlerName(String name) { 89 handlerName = name; 90 super.changed(); 91 } 92 93 public String getHandlerName() { 94 return handlerName; 95 } 96 97 101 public void addInitParam(NameValuePairDescriptor newInitParam) { 102 initParams.add(newInitParam); 103 super.changed(); 104 } 105 106 110 public void removeInitParam(NameValuePairDescriptor initParamToRemove) { 111 initParams.remove(initParamToRemove); 112 super.changed(); 113 } 114 115 118 public Collection getInitParams() { 119 return initParams; 120 } 121 122 public void addSoapHeader(QName soapHeader) { 123 soapHeaders.add(soapHeader); 124 super.changed(); 125 } 126 127 public void removeSoapHeader(QName soapHeader) { 128 soapHeaders.remove(soapHeader); 129 super.changed(); 130 } 131 132 public Collection getSoapHeaders() { 134 return soapHeaders; 135 } 136 137 public void addSoapRole(String soapRole) { 138 soapRoles.add(soapRole); 139 super.changed(); 140 } 141 142 public void removeSoapRole(String soapRole) { 143 soapRoles.remove(soapRole); 144 super.changed(); 145 } 146 147 public Collection getSoapRoles() { 148 return soapRoles; 149 } 150 151 public void addPortName(String portName) { 152 portNames.add(portName); 153 super.changed(); 154 } 155 156 public void removePortName(String portName) { 157 portNames.remove(portName); 158 super.changed(); 159 } 160 161 public Collection getPortNames() { 163 return portNames; 164 } 165 166 169 public void print(StringBuffer toStringBuffer) { 170 toStringBuffer.append("\nHandler name = ").append(handlerName).append( 171 "Handler class name = ").append(handlerClass); 172 for (Iterator i=getInitParams().iterator(); i.hasNext(); ) { 173 toStringBuffer.append("\n").append(i.next().toString()); 174 } 175 } 176 177 } 178 | Popular Tags |