Thu, 12 Oct 2017 19:44:07 +0800
merge
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
aoqi@0 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
aoqi@0 | 4 | * |
aoqi@0 | 5 | * This code is free software; you can redistribute it and/or modify it |
aoqi@0 | 6 | * under the terms of the GNU General Public License version 2 only, as |
aoqi@0 | 7 | * published by the Free Software Foundation. Oracle designates this |
aoqi@0 | 8 | * particular file as subject to the "Classpath" exception as provided |
aoqi@0 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
aoqi@0 | 10 | * |
aoqi@0 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
aoqi@0 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
aoqi@0 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
aoqi@0 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
aoqi@0 | 15 | * accompanied this code). |
aoqi@0 | 16 | * |
aoqi@0 | 17 | * You should have received a copy of the GNU General Public License version |
aoqi@0 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
aoqi@0 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
aoqi@0 | 20 | * |
aoqi@0 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
aoqi@0 | 22 | * or visit www.oracle.com if you need additional information or have any |
aoqi@0 | 23 | * questions. |
aoqi@0 | 24 | */ |
aoqi@0 | 25 | |
aoqi@0 | 26 | package com.sun.xml.internal.ws.policy.privateutil; |
aoqi@0 | 27 | |
aoqi@0 | 28 | import java.io.BufferedReader; |
aoqi@0 | 29 | import java.io.IOException; |
aoqi@0 | 30 | import java.io.InputStream; |
aoqi@0 | 31 | import java.io.InputStreamReader; |
aoqi@0 | 32 | import java.lang.reflect.Array; |
aoqi@0 | 33 | import java.net.URL; |
aoqi@0 | 34 | import java.util.ArrayList; |
aoqi@0 | 35 | import java.util.Enumeration; |
aoqi@0 | 36 | import java.util.Iterator; |
aoqi@0 | 37 | import java.util.List; |
aoqi@0 | 38 | import java.util.NoSuchElementException; |
aoqi@0 | 39 | import java.util.Set; |
aoqi@0 | 40 | import java.util.TreeSet; |
aoqi@0 | 41 | |
aoqi@0 | 42 | |
aoqi@0 | 43 | /** |
aoqi@0 | 44 | * |
aoqi@0 | 45 | * A simple service-provider lookup mechanism. A <i>service</i> is a |
aoqi@0 | 46 | * well-known set of interfaces and (usually abstract) classes. A <i>service |
aoqi@0 | 47 | * provider</i> is a specific implementation of a service. The classes in a |
aoqi@0 | 48 | * provider typically implement the interfaces and subclass the classes defined |
aoqi@0 | 49 | * in the service itself. Service providers may be installed in an |
aoqi@0 | 50 | * implementation of the Java platform in the form of extensions, that is, jar |
aoqi@0 | 51 | * files placed into any of the usual extension directories. Providers may |
aoqi@0 | 52 | * also be made available by adding them to the applet or application class |
aoqi@0 | 53 | * path or by some other platform-specific means. |
aoqi@0 | 54 | * <p/> |
aoqi@0 | 55 | * <p> In this lookup mechanism a service is represented by an interface or an |
aoqi@0 | 56 | * abstract class. (A concrete class may be used, but this is not |
aoqi@0 | 57 | * recommended.) A provider of a given service contains one or more concrete |
aoqi@0 | 58 | * classes that extend this <i>service class</i> with data and code specific to |
aoqi@0 | 59 | * the provider. This <i>provider class</i> will typically not be the entire |
aoqi@0 | 60 | * provider itself but rather a proxy that contains enough information to |
aoqi@0 | 61 | * decide whether the provider is able to satisfy a particular request together |
aoqi@0 | 62 | * with code that can create the actual provider on demand. The details of |
aoqi@0 | 63 | * provider classes tend to be highly service-specific; no single class or |
aoqi@0 | 64 | * interface could possibly unify them, so no such class has been defined. The |
aoqi@0 | 65 | * only requirement enforced here is that provider classes must have a |
aoqi@0 | 66 | * zero-argument constructor so that they may be instantiated during lookup. |
aoqi@0 | 67 | * <p/> |
aoqi@0 | 68 | * <p> A service provider identifies itself by placing a provider-configuration |
aoqi@0 | 69 | * file in the resource directory <tt>META-INF/services</tt>. The file's name |
aoqi@0 | 70 | * should consist of the fully-qualified name of the abstract service class. |
aoqi@0 | 71 | * The file should contain a list of fully-qualified concrete provider-class |
aoqi@0 | 72 | * names, one per line. Space and tab characters surrounding each name, as |
aoqi@0 | 73 | * well as blank lines, are ignored. The comment character is <tt>'#'</tt> |
aoqi@0 | 74 | * (<tt>0x23</tt>); on each line all characters following the first comment |
aoqi@0 | 75 | * character are ignored. The file must be encoded in UTF-8. |
aoqi@0 | 76 | * <p/> |
aoqi@0 | 77 | * <p> If a particular concrete provider class is named in more than one |
aoqi@0 | 78 | * configuration file, or is named in the same configuration file more than |
aoqi@0 | 79 | * once, then the duplicates will be ignored. The configuration file naming a |
aoqi@0 | 80 | * particular provider need not be in the same jar file or other distribution |
aoqi@0 | 81 | * unit as the provider itself. The provider must be accessible from the same |
aoqi@0 | 82 | * class loader that was initially queried to locate the configuration file; |
aoqi@0 | 83 | * note that this is not necessarily the class loader that found the file. |
aoqi@0 | 84 | * <p/> |
aoqi@0 | 85 | * <p> <b>Example:</b> Suppose we have a service class named |
aoqi@0 | 86 | * <tt>java.io.spi.CharCodec</tt>. It has two abstract methods: |
aoqi@0 | 87 | * <p/> |
aoqi@0 | 88 | * <pre> |
aoqi@0 | 89 | * public abstract CharEncoder getEncoder(String encodingName); |
aoqi@0 | 90 | * public abstract CharDecoder getDecoder(String encodingName); |
aoqi@0 | 91 | * </pre> |
aoqi@0 | 92 | * <p/> |
aoqi@0 | 93 | * Each method returns an appropriate object or <tt>null</tt> if it cannot |
aoqi@0 | 94 | * translate the given encoding. Typical <tt>CharCodec</tt> providers will |
aoqi@0 | 95 | * support more than one encoding. |
aoqi@0 | 96 | * <p/> |
aoqi@0 | 97 | * <p> If <tt>sun.io.StandardCodec</tt> is a provider of the <tt>CharCodec</tt> |
aoqi@0 | 98 | * service then its jar file would contain the file |
aoqi@0 | 99 | * <tt>META-INF/services/java.io.spi.CharCodec</tt>. This file would contain |
aoqi@0 | 100 | * the single line: |
aoqi@0 | 101 | * <p/> |
aoqi@0 | 102 | * <pre> |
aoqi@0 | 103 | * sun.io.StandardCodec # Standard codecs for the platform |
aoqi@0 | 104 | * </pre> |
aoqi@0 | 105 | * <p/> |
aoqi@0 | 106 | * To locate an encoder for a given encoding name, the internal I/O code would |
aoqi@0 | 107 | * do something like this: |
aoqi@0 | 108 | * <p/> |
aoqi@0 | 109 | * <pre> |
aoqi@0 | 110 | * CharEncoder getEncoder(String encodingName) { |
aoqi@0 | 111 | * for( CharCodec cc : ServiceFinder.find(CharCodec.class) ) { |
aoqi@0 | 112 | * CharEncoder ce = cc.getEncoder(encodingName); |
aoqi@0 | 113 | * if (ce != null) |
aoqi@0 | 114 | * return ce; |
aoqi@0 | 115 | * } |
aoqi@0 | 116 | * return null; |
aoqi@0 | 117 | * } |
aoqi@0 | 118 | * </pre> |
aoqi@0 | 119 | * <p/> |
aoqi@0 | 120 | * The provider-lookup mechanism always executes in the security context of the |
aoqi@0 | 121 | * caller. Trusted system code should typically invoke the methods in this |
aoqi@0 | 122 | * class from within a privileged security context. |
aoqi@0 | 123 | * |
aoqi@0 | 124 | * @author Mark Reinhold |
aoqi@0 | 125 | * @version 1.11, 03/12/19 |
aoqi@0 | 126 | * @since 1.3 |
aoqi@0 | 127 | */ |
aoqi@0 | 128 | final class ServiceFinder<T> implements Iterable<T> { |
aoqi@0 | 129 | private static final PolicyLogger LOGGER = PolicyLogger.getLogger(ServiceFinder.class); |
aoqi@0 | 130 | |
aoqi@0 | 131 | private static final String prefix = "META-INF/services/"; |
aoqi@0 | 132 | |
aoqi@0 | 133 | private final Class<T> serviceClass; |
aoqi@0 | 134 | private final ClassLoader classLoader; |
aoqi@0 | 135 | |
aoqi@0 | 136 | /** |
aoqi@0 | 137 | * Locates and incrementally instantiates the available providers of a |
aoqi@0 | 138 | * given service using the given class loader. |
aoqi@0 | 139 | * <p/> |
aoqi@0 | 140 | * <p> This method transforms the name of the given service class into a |
aoqi@0 | 141 | * provider-configuration filename as described above and then uses the |
aoqi@0 | 142 | * <tt>getResources</tt> method of the given class loader to find all |
aoqi@0 | 143 | * available files with that name. These files are then read and parsed to |
aoqi@0 | 144 | * produce a list of provider-class names. The iterator that is returned |
aoqi@0 | 145 | * uses the given class loader to lookup and then instantiate each element |
aoqi@0 | 146 | * of the list. |
aoqi@0 | 147 | * <p/> |
aoqi@0 | 148 | * <p> Because it is possible for extensions to be installed into a running |
aoqi@0 | 149 | * Java virtual machine, this method may return different results each time |
aoqi@0 | 150 | * it is invoked. <p> |
aoqi@0 | 151 | * |
aoqi@0 | 152 | * @param service The service's abstract service class |
aoqi@0 | 153 | * @param loader The class loader to be used to load provider-configuration files |
aoqi@0 | 154 | * and instantiate provider classes, or <tt>null</tt> if the system |
aoqi@0 | 155 | * class loader (or, failing that the bootstrap class loader) is to |
aoqi@0 | 156 | * be used |
aoqi@0 | 157 | * @throws ServiceConfigurationError If a provider-configuration file violates the specified format |
aoqi@0 | 158 | * or names a provider class that cannot be found and instantiated |
aoqi@0 | 159 | * @see #find(Class) |
aoqi@0 | 160 | */ |
aoqi@0 | 161 | static <T> ServiceFinder<T> find(final Class<T> service, final ClassLoader loader) { |
aoqi@0 | 162 | if (null==service) { |
aoqi@0 | 163 | throw LOGGER.logSevereException(new NullPointerException(LocalizationMessages.WSP_0032_SERVICE_CAN_NOT_BE_NULL())); |
aoqi@0 | 164 | } |
aoqi@0 | 165 | return new ServiceFinder<T>(service,loader); |
aoqi@0 | 166 | } |
aoqi@0 | 167 | |
aoqi@0 | 168 | /** |
aoqi@0 | 169 | * Locates and incrementally instantiates the available providers of a |
aoqi@0 | 170 | * given service using the context class loader. This convenience method |
aoqi@0 | 171 | * is equivalent to |
aoqi@0 | 172 | * <p/> |
aoqi@0 | 173 | * <pre> |
aoqi@0 | 174 | * ClassLoader cl = Thread.currentThread().getContextClassLoader(); |
aoqi@0 | 175 | * return Service.providers(service, cl); |
aoqi@0 | 176 | * </pre> |
aoqi@0 | 177 | * |
aoqi@0 | 178 | * @param service The service's abstract service class |
aoqi@0 | 179 | * |
aoqi@0 | 180 | * @throws ServiceConfigurationError If a provider-configuration file violates the specified format |
aoqi@0 | 181 | * or names a provider class that cannot be found and instantiated |
aoqi@0 | 182 | * @see #find(Class, ClassLoader) |
aoqi@0 | 183 | */ |
aoqi@0 | 184 | public static <T> ServiceFinder<T> find(final Class<T> service) { |
aoqi@0 | 185 | return find(service,Thread.currentThread().getContextClassLoader()); |
aoqi@0 | 186 | } |
aoqi@0 | 187 | |
aoqi@0 | 188 | private ServiceFinder(Class<T> service, ClassLoader loader) { |
aoqi@0 | 189 | this.serviceClass = service; |
aoqi@0 | 190 | this.classLoader = loader; |
aoqi@0 | 191 | } |
aoqi@0 | 192 | |
aoqi@0 | 193 | /** |
aoqi@0 | 194 | * Returns discovered objects incrementally. |
aoqi@0 | 195 | * |
aoqi@0 | 196 | * @return An <tt>Iterator</tt> that yields provider objects for the given |
aoqi@0 | 197 | * service, in some arbitrary order. The iterator will throw a |
aoqi@0 | 198 | * <tt>ServiceConfigurationError</tt> if a provider-configuration |
aoqi@0 | 199 | * file violates the specified format or if a provider class cannot |
aoqi@0 | 200 | * be found and instantiated. |
aoqi@0 | 201 | */ |
aoqi@0 | 202 | public Iterator<T> iterator() { |
aoqi@0 | 203 | return new LazyIterator<T>(serviceClass,classLoader); |
aoqi@0 | 204 | } |
aoqi@0 | 205 | |
aoqi@0 | 206 | /** |
aoqi@0 | 207 | * Returns discovered objects all at once. |
aoqi@0 | 208 | * |
aoqi@0 | 209 | * @return |
aoqi@0 | 210 | * can be empty but never null. |
aoqi@0 | 211 | * |
aoqi@0 | 212 | * @throws ServiceConfigurationError |
aoqi@0 | 213 | */ |
aoqi@0 | 214 | @SuppressWarnings({"unchecked"}) |
aoqi@0 | 215 | public T[] toArray() { |
aoqi@0 | 216 | List<T> result = new ArrayList<T>(); |
aoqi@0 | 217 | for (T t : this) { |
aoqi@0 | 218 | result.add(t); |
aoqi@0 | 219 | } |
aoqi@0 | 220 | return result.toArray((T[])Array.newInstance(serviceClass,result.size())); |
aoqi@0 | 221 | } |
aoqi@0 | 222 | |
aoqi@0 | 223 | private static void fail(final Class service, final String msg, final Throwable cause) |
aoqi@0 | 224 | throws ServiceConfigurationError { |
aoqi@0 | 225 | final ServiceConfigurationError sce |
aoqi@0 | 226 | = new ServiceConfigurationError(LocalizationMessages.WSP_0025_SPI_FAIL_SERVICE_MSG(service.getName(), msg)); |
aoqi@0 | 227 | if (null != cause) { |
aoqi@0 | 228 | sce.initCause(cause); |
aoqi@0 | 229 | } |
aoqi@0 | 230 | |
aoqi@0 | 231 | throw LOGGER.logSevereException(sce); |
aoqi@0 | 232 | } |
aoqi@0 | 233 | |
aoqi@0 | 234 | /* private static void fail(Class service, String msg) |
aoqi@0 | 235 | throws ServiceConfigurationError { |
aoqi@0 | 236 | throw new ServiceConfigurationError(LocalizationMessages.WSP_0025_SPI_FAIL_SERVICE_MSG(service.getName(), msg)); |
aoqi@0 | 237 | }*/ |
aoqi@0 | 238 | |
aoqi@0 | 239 | private static void fail(final Class service, final URL u, final int line, final String msg, final Throwable cause) |
aoqi@0 | 240 | throws ServiceConfigurationError { |
aoqi@0 | 241 | fail(service, LocalizationMessages.WSP_0024_SPI_FAIL_SERVICE_URL_LINE_MSG(u , line, msg), cause); |
aoqi@0 | 242 | } |
aoqi@0 | 243 | |
aoqi@0 | 244 | /** |
aoqi@0 | 245 | * Parse a single line from the given configuration file, adding the name |
aoqi@0 | 246 | * on the line to both the names list and the returned set iff the name is |
aoqi@0 | 247 | * not already a member of the returned set. |
aoqi@0 | 248 | */ |
aoqi@0 | 249 | private static int parseLine(final Class service, final URL u, final BufferedReader r, final int lc, |
aoqi@0 | 250 | final List<String> names, final Set<String> returned) |
aoqi@0 | 251 | throws IOException, ServiceConfigurationError { |
aoqi@0 | 252 | String ln = r.readLine(); |
aoqi@0 | 253 | if (ln == null) { |
aoqi@0 | 254 | return -1; |
aoqi@0 | 255 | } |
aoqi@0 | 256 | final int ci = ln.indexOf('#'); |
aoqi@0 | 257 | if (ci >= 0) ln = ln.substring(0, ci); |
aoqi@0 | 258 | ln = ln.trim(); |
aoqi@0 | 259 | final int n = ln.length(); |
aoqi@0 | 260 | if (n != 0) { |
aoqi@0 | 261 | if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0)) |
aoqi@0 | 262 | fail(service, u, lc, LocalizationMessages.WSP_0067_ILLEGAL_CFG_FILE_SYNTAX(), null); |
aoqi@0 | 263 | int cp = ln.codePointAt(0); |
aoqi@0 | 264 | if (!Character.isJavaIdentifierStart(cp)) |
aoqi@0 | 265 | fail(service, u, lc, LocalizationMessages.WSP_0066_ILLEGAL_PROVIDER_CLASSNAME(ln), null); |
aoqi@0 | 266 | for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) { |
aoqi@0 | 267 | cp = ln.codePointAt(i); |
aoqi@0 | 268 | if (!Character.isJavaIdentifierPart(cp) && (cp != '.')) |
aoqi@0 | 269 | fail(service, u, lc, LocalizationMessages.WSP_0066_ILLEGAL_PROVIDER_CLASSNAME(ln), null); |
aoqi@0 | 270 | } |
aoqi@0 | 271 | if (!returned.contains(ln)) { |
aoqi@0 | 272 | names.add(ln); |
aoqi@0 | 273 | returned.add(ln); |
aoqi@0 | 274 | } |
aoqi@0 | 275 | } |
aoqi@0 | 276 | return lc + 1; |
aoqi@0 | 277 | } |
aoqi@0 | 278 | |
aoqi@0 | 279 | /** |
aoqi@0 | 280 | * Parse the content of the given URL as a provider-configuration file. |
aoqi@0 | 281 | * |
aoqi@0 | 282 | * @param service The service class for which providers are being sought; |
aoqi@0 | 283 | * used to construct error detail strings |
aoqi@0 | 284 | * @param u The URL naming the configuration file to be parsed |
aoqi@0 | 285 | * @param returned A Set containing the names of provider classes that have already |
aoqi@0 | 286 | * been returned. This set will be updated to contain the names |
aoqi@0 | 287 | * that will be yielded from the returned <tt>Iterator</tt>. |
aoqi@0 | 288 | * @return A (possibly empty) <tt>Iterator</tt> that will yield the |
aoqi@0 | 289 | * provider-class names in the given configuration file that are |
aoqi@0 | 290 | * not yet members of the returned set |
aoqi@0 | 291 | * @throws ServiceConfigurationError If an I/O error occurs while reading from the given URL, or |
aoqi@0 | 292 | * if a configuration-file format error is detected |
aoqi@0 | 293 | */ |
aoqi@0 | 294 | @SuppressWarnings({"StatementWithEmptyBody"}) |
aoqi@0 | 295 | private static Iterator<String> parse(Class service, URL u, Set<String> returned) |
aoqi@0 | 296 | throws ServiceConfigurationError { |
aoqi@0 | 297 | InputStream in = null; |
aoqi@0 | 298 | BufferedReader r = null; |
aoqi@0 | 299 | ArrayList<String> names = new ArrayList<String>(); |
aoqi@0 | 300 | try { |
aoqi@0 | 301 | in = u.openStream(); |
aoqi@0 | 302 | r = new BufferedReader(new InputStreamReader(in, "utf-8")); |
aoqi@0 | 303 | int lc = 1; |
aoqi@0 | 304 | while ((lc = parseLine(service, u, r, lc, names, returned)) >= 0) ; |
aoqi@0 | 305 | } catch (IOException x) { |
aoqi@0 | 306 | fail(service, ": " + x, x); |
aoqi@0 | 307 | } finally { |
aoqi@0 | 308 | try { |
aoqi@0 | 309 | if (r != null) r.close(); |
aoqi@0 | 310 | if (in != null) in.close(); |
aoqi@0 | 311 | } catch (IOException y) { |
aoqi@0 | 312 | fail(service, ": " + y, y); |
aoqi@0 | 313 | } |
aoqi@0 | 314 | } |
aoqi@0 | 315 | return names.iterator(); |
aoqi@0 | 316 | } |
aoqi@0 | 317 | |
aoqi@0 | 318 | |
aoqi@0 | 319 | /** |
aoqi@0 | 320 | * Private inner class implementing fully-lazy provider lookup |
aoqi@0 | 321 | */ |
aoqi@0 | 322 | private static class LazyIterator<T> implements Iterator<T> { |
aoqi@0 | 323 | Class<T> service; |
aoqi@0 | 324 | ClassLoader loader; |
aoqi@0 | 325 | Enumeration<URL> configs = null; |
aoqi@0 | 326 | Iterator<String> pending = null; |
aoqi@0 | 327 | Set<String> returned = new TreeSet<String>(); |
aoqi@0 | 328 | String nextName = null; |
aoqi@0 | 329 | |
aoqi@0 | 330 | private LazyIterator(Class<T> service, ClassLoader loader) { |
aoqi@0 | 331 | this.service = service; |
aoqi@0 | 332 | this.loader = loader; |
aoqi@0 | 333 | } |
aoqi@0 | 334 | |
aoqi@0 | 335 | public boolean hasNext() throws ServiceConfigurationError { |
aoqi@0 | 336 | if (nextName != null) { |
aoqi@0 | 337 | return true; |
aoqi@0 | 338 | } |
aoqi@0 | 339 | if (configs == null) { |
aoqi@0 | 340 | try { |
aoqi@0 | 341 | final String fullName = prefix + service.getName(); |
aoqi@0 | 342 | if (loader == null) |
aoqi@0 | 343 | configs = ClassLoader.getSystemResources(fullName); |
aoqi@0 | 344 | else |
aoqi@0 | 345 | configs = loader.getResources(fullName); |
aoqi@0 | 346 | } catch (IOException x) { |
aoqi@0 | 347 | fail(service, ": " + x, x); |
aoqi@0 | 348 | } |
aoqi@0 | 349 | } |
aoqi@0 | 350 | while ((pending == null) || !pending.hasNext()) { |
aoqi@0 | 351 | if (!configs.hasMoreElements()) { |
aoqi@0 | 352 | return false; |
aoqi@0 | 353 | } |
aoqi@0 | 354 | pending = parse(service, configs.nextElement(), returned); |
aoqi@0 | 355 | } |
aoqi@0 | 356 | nextName = pending.next(); |
aoqi@0 | 357 | return true; |
aoqi@0 | 358 | } |
aoqi@0 | 359 | |
aoqi@0 | 360 | public T next() throws ServiceConfigurationError { |
aoqi@0 | 361 | if (!hasNext()) { |
aoqi@0 | 362 | throw new NoSuchElementException(); |
aoqi@0 | 363 | } |
aoqi@0 | 364 | final String cn = nextName; |
aoqi@0 | 365 | nextName = null; |
aoqi@0 | 366 | try { |
aoqi@0 | 367 | return service.cast(Class.forName(cn, true, loader).newInstance()); |
aoqi@0 | 368 | } catch (ClassNotFoundException x) { |
aoqi@0 | 369 | fail(service, LocalizationMessages.WSP_0027_SERVICE_PROVIDER_NOT_FOUND(cn), x); |
aoqi@0 | 370 | } catch (Exception x) { |
aoqi@0 | 371 | fail(service, LocalizationMessages.WSP_0028_SERVICE_PROVIDER_COULD_NOT_BE_INSTANTIATED(cn), x); |
aoqi@0 | 372 | } |
aoqi@0 | 373 | return null; /* This cannot happen */ |
aoqi@0 | 374 | } |
aoqi@0 | 375 | |
aoqi@0 | 376 | public void remove() { |
aoqi@0 | 377 | throw new UnsupportedOperationException(); |
aoqi@0 | 378 | } |
aoqi@0 | 379 | } |
aoqi@0 | 380 | } |