1 19 20 package org.netbeans.modules.websvc.api.client; 21 22 import java.io.IOException ; 23 import java.util.Iterator ; 24 import java.util.List ; 25 26 import org.openide.filesystems.FileObject; 27 import org.openide.util.Lookup; 28 29 import org.netbeans.modules.websvc.spi.client.WebServicesClientSupportImpl; 30 import org.netbeans.modules.websvc.spi.client.WebServicesClientSupportProvider; 31 import org.netbeans.modules.websvc.client.WebServicesClientSupportAccessor; 32 33 42 public final class WebServicesClientSupport { 43 44 public static final String WSCLIENTUPTODATE_CLASSPATH = "wsclientuptodate.classpath"; 45 46 private WebServicesClientSupportImpl impl; 47 private static final Lookup.Result implementations = 48 Lookup.getDefault().lookup(new Lookup.Template(WebServicesClientSupportProvider.class)); 49 50 static { 51 WebServicesClientSupportAccessor.DEFAULT = new WebServicesClientSupportAccessor() { 52 public WebServicesClientSupport createWebServicesClientSupport(WebServicesClientSupportImpl spiWebServicesClientSupport) { 53 return new WebServicesClientSupport(spiWebServicesClientSupport); 54 } 55 56 public WebServicesClientSupportImpl getWebServicesClientSupportImpl(WebServicesClientSupport wscs) { 57 return wscs == null ? null : wscs.impl; 58 } 59 }; 60 } 61 62 private WebServicesClientSupport(WebServicesClientSupportImpl impl) { 63 if (impl == null) 64 throw new IllegalArgumentException (); 65 this.impl = impl; 66 } 67 68 71 public static WebServicesClientSupport getWebServicesClientSupport (FileObject f) { 72 if (f == null) { 73 throw new NullPointerException ("Passed null to WebServicesClientSupport.getWebServicesClientSupport(FileObject)"); } 75 Iterator it = implementations.allInstances().iterator(); 76 while (it.hasNext()) { 77 WebServicesClientSupportProvider impl = (WebServicesClientSupportProvider)it.next(); 78 WebServicesClientSupport wscs = impl.findWebServicesClientSupport (f); 79 if (wscs != null) { 80 return wscs; 81 } 82 } 83 return null; 84 } 85 86 88 106 public void addServiceClient(String serviceName, String packageName, String sourceUrl, FileObject configFile, ClientStubDescriptor stubDescriptor) { 107 impl.addServiceClient(serviceName, packageName, sourceUrl, configFile, stubDescriptor); 108 } 109 110 public void addServiceClient(String serviceName, String packageName, String sourceUrl, FileObject configFile, ClientStubDescriptor stubDescriptor, String [] wscompileFeatures) { 111 impl.addServiceClient(serviceName, packageName, sourceUrl, configFile, stubDescriptor, wscompileFeatures); 112 } 113 114 122 public void addServiceClientReference(String serviceName, String fqServiceName, String relativeWsdlPath, String mappingPath, String [] portSEIInfo) { 123 impl.addServiceClientReference(serviceName, fqServiceName, relativeWsdlPath, mappingPath, portSEIInfo); 124 } 125 126 140 public void removeServiceClient(String serviceName) { 141 impl.removeServiceClient(serviceName); 142 } 143 144 159 public FileObject getWsdlFolder(boolean create) throws IOException { 160 return impl.getWsdlFolder(create); 161 } 162 163 168 public FileObject getWsdlFolder() { 169 FileObject result = null; 170 171 try { 172 result = impl.getWsdlFolder(false); 173 } catch(IOException ex) { 174 } 176 177 return result; 178 } 179 180 195 public FileObject getDeploymentDescriptor() { 196 return impl.getDeploymentDescriptor(); 197 } 198 199 public List getStubDescriptors() { 200 return impl.getStubDescriptors(); 201 } 202 203 public List getServiceClients() { 204 return impl.getServiceClients(); 205 } 206 207 public String getWsdlSource(String serviceName) { 208 return impl.getWsdlSource(serviceName); 209 } 210 211 public void setWsdlSource(String serviceName, String wsdlSource) { 212 impl.setWsdlSource(serviceName, wsdlSource); 213 } 214 215 public void setProxyJVMOptions(String proxyHost, String proxyPort) { 216 impl.setProxyJVMOptions(proxyHost, proxyPort); 217 } 218 219 public String getServiceRefName(String serviceName){ 220 return impl.getServiceRefName(serviceName); 221 } 222 223 238 } | Popular Tags |