1 19 20 package org.netbeans.modules.websvc.api.jaxws.client; 21 22 import java.io.IOException ; 23 import java.net.URL ; 24 import java.util.Iterator ; 25 import java.util.List ; 26 import org.netbeans.modules.websvc.jaxws.client.JAXWSClientSupportAccessor; 27 import org.netbeans.modules.websvc.spi.jaxws.client.JAXWSClientSupportImpl; 28 29 import org.openide.filesystems.FileObject; 30 import org.openide.util.Lookup; 31 import org.netbeans.modules.websvc.spi.client.WebServicesClientSupportProvider; 32 import org.openide.nodes.Node; 33 34 43 public final class JAXWSClientSupport { 44 45 private JAXWSClientSupportImpl impl; 46 private static final Lookup.Result implementations = 47 Lookup.getDefault().lookup(new Lookup.Template(WebServicesClientSupportProvider.class)); 48 49 static { 50 JAXWSClientSupportAccessor.DEFAULT = new JAXWSClientSupportAccessor() { 51 public JAXWSClientSupport createJAXWSClientSupport(JAXWSClientSupportImpl spiWebServicesClientSupport) { 52 return new JAXWSClientSupport(spiWebServicesClientSupport); 53 } 54 55 public JAXWSClientSupportImpl getJAXWSClientSupportImpl(JAXWSClientSupport wscs) { 56 return wscs == null ? null : wscs.impl; 57 } 58 }; 59 } 60 61 private JAXWSClientSupport(JAXWSClientSupportImpl impl) { 62 if (impl == null) 63 throw new IllegalArgumentException (); 64 this.impl = impl; 65 } 66 67 70 public static JAXWSClientSupport getJaxWsClientSupport (FileObject f) { 71 if (f == null) { 72 throw new NullPointerException ("Passed null to JAXWSClientSupport.getJAXWSClientSupport(FileObject)"); } 74 Iterator it = implementations.allInstances().iterator(); 75 while (it.hasNext()) { 76 WebServicesClientSupportProvider impl = (WebServicesClientSupportProvider)it.next(); 77 JAXWSClientSupport wscs = impl.findJAXWSClientSupport (f); 78 if (wscs != null) { 79 return wscs; 80 } 81 } 82 return null; 83 } 84 85 87 100 public String addServiceClient(String serviceName, String wsdlUrl, String packageName, boolean isJsr109) { 101 return impl.addServiceClient(serviceName, wsdlUrl, packageName, isJsr109); 102 } 103 104 105 113 public void removeServiceClient(String serviceName) { 114 impl.removeServiceClient(serviceName); 115 } 116 117 123 public FileObject getWsdlFolder(boolean create) throws IOException { 124 return impl.getWsdlFolder(create); 125 } 126 127 134 public FileObject getLocalWsdlFolderForClient(String clientName, boolean createFolder) { 135 return impl.getLocalWsdlFolderForClient(clientName,createFolder); 136 } 137 138 145 public FileObject getBindingsFolderForClient(String clientName, boolean createFolder) { 146 return impl.getBindingsFolderForClient(clientName,createFolder); 147 } 148 149 153 public URL getCatalog() { 154 return impl.getCatalog(); 155 } 156 157 160 public List getServiceClients() { 161 return impl.getServiceClients(); 162 } 163 164 167 public String getServiceRefName(Node clientNode){ 168 return impl.getServiceRefName(clientNode); 169 } 170 } | Popular Tags |