1 19 20 package org.netbeans.modules.websvc.jaxws.api; 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.JAXWSSupportAccessor; 27 import org.netbeans.modules.websvc.jaxws.spi.JAXWSSupportImpl; 28 import org.netbeans.modules.websvc.jaxws.spi.JAXWSSupportProvider; 29 import org.netbeans.spi.project.support.ant.AntProjectHelper; 30 import org.openide.filesystems.FileObject; 31 import org.openide.util.Lookup; 32 33 42 public final class JAXWSSupport { 43 44 private JAXWSSupportImpl impl; 45 private static final Lookup.Result<JAXWSSupportProvider> implementations = 46 Lookup.getDefault().lookup(new Lookup.Template<JAXWSSupportProvider>(JAXWSSupportProvider.class)); 47 48 static { 49 JAXWSSupportAccessor.DEFAULT = new JAXWSSupportAccessor() { 50 public JAXWSSupport createJAXWSSupport(JAXWSSupportImpl spiWebServicesSupport) { 51 return new JAXWSSupport(spiWebServicesSupport); 52 } 53 54 public JAXWSSupportImpl getJAXWSSupportImpl(JAXWSSupport wss) { 55 return wss == null ? null : wss.impl; 56 } 57 }; 58 } 59 60 private JAXWSSupport(JAXWSSupportImpl impl) { 61 if (impl == null) 62 throw new IllegalArgumentException (); 63 this.impl = impl; 64 } 65 66 69 public static JAXWSSupport getJAXWSSupport(FileObject f) { 70 if (f == null) { 71 throw new NullPointerException ("Passed null to WebServicesSupport.getWebServicesSupport(FileObject)"); } 73 Iterator it = implementations.allInstances().iterator(); 74 while (it.hasNext()) { 75 JAXWSSupportProvider supportProvider = (JAXWSSupportProvider)it.next(); 76 JAXWSSupport wss = supportProvider.findJAXWSSupport(f); 77 if (wss != null) { 78 return wss; 79 } 80 } 81 return null; 82 } 83 84 86 92 public void addService(String serviceName, String serviceImpl, boolean isJsr109) { 93 impl.addService(serviceName, serviceImpl, isJsr109); 94 } 95 96 107 public String addService(String name, String serviceImpl, String wsdlUrl, 108 String serviceName, String portName, String packageName, boolean isJsr109) { 109 return impl.addService(name, serviceImpl, wsdlUrl, serviceName, portName, packageName, isJsr109); 110 } 111 112 116 public List getServices() { 117 return impl.getServices(); 118 } 119 120 125 public void removeService(String serviceName) { 126 impl.removeService(serviceName); 127 } 128 129 135 public void serviceFromJavaRemoved(String serviceName) { 136 impl.serviceFromJavaRemoved(serviceName); 137 } 138 139 144 public String getServiceImpl(String serviceName) { 145 return impl.getServiceImpl(serviceName); 146 } 147 148 151 public boolean isFromWSDL(String serviceName) { 152 return impl.isFromWSDL(serviceName); 153 } 154 155 161 public FileObject getWsdlFolder(boolean create) throws java.io.IOException { 162 return impl.getWsdlFolder(create); 163 } 164 165 172 public FileObject getLocalWsdlFolderForService(String serviceName, boolean createFolder) { 173 return impl.getLocalWsdlFolderForService(serviceName,createFolder); 174 } 175 176 183 public FileObject getBindingsFolderForService(String serviceName, boolean createFolder) { 184 return impl.getBindingsFolderForService(serviceName,createFolder); 185 } 186 187 190 public AntProjectHelper getAntProjectHelper() { 191 return impl.getAntProjectHelper(); 192 } 193 194 196 public URL getCatalog() { 197 return impl.getCatalog(); 198 } 199 200 204 public String getWsdlLocation(String serviceName) { 205 return impl.getWsdlLocation(serviceName); 206 } 207 208 214 public void removeNonJsr109Entries(String serviceName) throws IOException { 215 impl.removeNonJsr109Entries(serviceName); 216 } 217 220 public FileObject getDeploymentDescriptorFolder(){ 221 return impl.getDeploymentDescriptorFolder(); 222 } 223 } 224 | Popular Tags |