1 19 20 package org.netbeans.modules.websvc.client; 21 22 import java.io.IOException ; 23 import java.net.URL ; 24 import java.util.HashMap ; 25 import java.util.List ; 26 import java.util.Map ; 27 import org.netbeans.modules.websvc.api.client.ClientStubDescriptor; 28 import org.netbeans.modules.websvc.api.client.WebServicesClientSupport; 29 import org.netbeans.modules.websvc.api.jaxws.client.JAXWSClientSupport; 30 import org.netbeans.modules.websvc.spi.client.WebServicesClientSupportFactory; 31 import org.netbeans.modules.websvc.spi.client.WebServicesClientSupportImpl; 32 import org.netbeans.modules.websvc.spi.client.WebServicesClientSupportProvider; 33 import org.netbeans.modules.websvc.spi.jaxws.client.JAXWSClientSupportFactory; 34 import org.netbeans.modules.websvc.spi.jaxws.client.JAXWSClientSupportImpl; 35 import org.openide.filesystems.FileObject; 36 import org.openide.nodes.Node; 37 38 42 public class CustomWebServicesClientSupportProvider implements WebServicesClientSupportProvider { 43 44 private Map <FileObject, WebServicesClientSupport> cache = new HashMap <FileObject, WebServicesClientSupport>(); 45 private Map <FileObject, JAXWSClientSupport> cache2 = new HashMap <FileObject, JAXWSClientSupport>(); 46 47 48 public CustomWebServicesClientSupportProvider() { 49 } 50 51 public WebServicesClientSupport findWebServicesClientSupport(FileObject file) { 52 if (file.getExt().equals("ws") || file.getExt().equals("both")) { 53 WebServicesClientSupport em = (WebServicesClientSupport) cache.get(file.getParent()); 54 if (em == null) { 55 em = WebServicesClientSupportFactory.createWebServicesClientSupport(new CustomWebServicesClientSupportImpl(file)); 56 cache.put(file.getParent(), em); 57 } 58 return em; 59 } 60 return null; 61 } 62 63 public JAXWSClientSupport findJAXWSClientSupport(FileObject file) { 64 if (file.getExt().equals("jaxws") || file.getExt().equals("both")) { 65 JAXWSClientSupport em = cache2.get(file.getParent()); 66 if (em == null) { 67 em = JAXWSClientSupportFactory.createJAXWSClientSupport(new CustomJAXWSClientSupportImpl(file)); 68 cache2.put(file.getParent(), em); 69 } 70 return em; 71 } 72 return null; 73 } 74 75 private static final class CustomWebServicesClientSupportImpl implements WebServicesClientSupportImpl { 76 77 private FileObject fo; 78 79 CustomWebServicesClientSupportImpl(FileObject fo) { 80 this.fo = fo; 81 } 82 83 public void addServiceClient(String serviceName, String packageName, 84 String sourceUrl, FileObject configFile, 85 ClientStubDescriptor stubDescriptor) { 86 throw new UnsupportedOperationException ("Not supported yet."); 87 } 88 89 public void addServiceClient(String serviceName, String packageName, 90 String sourceUrl, FileObject configFile, 91 ClientStubDescriptor stubDescriptor, 92 String [] wscompileFeatures) { 93 throw new UnsupportedOperationException ("Not supported yet."); 94 } 95 96 public void addServiceClientReference(String serviceName, 97 String fqServiceName, 98 String relativeWsdlPath, 99 String mappingPath, 100 String [] portSEIInfo) { 101 throw new UnsupportedOperationException ("Not supported yet."); 102 } 103 104 public void removeServiceClient(String serviceName) { 105 throw new UnsupportedOperationException ("Not supported yet."); 106 } 107 108 public FileObject getWsdlFolder(boolean create) throws IOException { 109 throw new UnsupportedOperationException ("Not supported yet."); 110 } 111 112 public FileObject getDeploymentDescriptor() { 113 throw new UnsupportedOperationException ("Not supported yet."); 114 } 115 116 public List getStubDescriptors() { 117 throw new UnsupportedOperationException ("Not supported yet."); 118 } 119 120 public List getServiceClients() { 121 throw new UnsupportedOperationException ("Not supported yet."); 122 } 123 124 public String getWsdlSource(String serviceName) { 125 throw new UnsupportedOperationException ("Not supported yet."); 126 } 127 128 public void setWsdlSource(String serviceName, String wsdlSource) { 129 throw new UnsupportedOperationException ("Not supported yet."); 130 } 131 132 public void setProxyJVMOptions(String proxyHost, String proxyPort) { 133 throw new UnsupportedOperationException ("Not supported yet."); 134 } 135 136 public String getServiceRefName(String serviceName) { 137 throw new UnsupportedOperationException ("Not supported yet."); 138 } 139 } 140 141 private static final class CustomJAXWSClientSupportImpl implements JAXWSClientSupportImpl { 142 143 private FileObject fo; 144 145 CustomJAXWSClientSupportImpl(FileObject fo) { 146 this.fo = fo; 147 } 148 149 public String addServiceClient(String clientName, String wsdlUrl, 150 String packageName, boolean isJsr109) { 151 throw new UnsupportedOperationException ("Not supported yet."); 152 } 153 154 public FileObject getWsdlFolder(boolean create) throws IOException { 155 throw new UnsupportedOperationException ("Not supported yet."); 156 } 157 158 public FileObject getLocalWsdlFolderForClient(String clientName, 159 boolean createFolder) { 160 throw new UnsupportedOperationException ("Not supported yet."); 161 } 162 163 public FileObject getBindingsFolderForClient(String clientName, 164 boolean createFolder) { 165 throw new UnsupportedOperationException ("Not supported yet."); 166 } 167 168 public void removeServiceClient(String serviceName) { 169 throw new UnsupportedOperationException ("Not supported yet."); 170 } 171 172 public List getServiceClients() { 173 throw new UnsupportedOperationException ("Not supported yet."); 174 } 175 176 public URL getCatalog() { 177 throw new UnsupportedOperationException ("Not supported yet."); 178 } 179 180 public String getServiceRefName(Node clientNode) { 181 throw new UnsupportedOperationException ("Not supported yet."); 182 } 183 } 184 } 185 | Popular Tags |