Lines Matching refs:service

43  * A simple service-provider lookup mechanism.  A <i>service</i> is a
44 * well-known set of interfaces and (usually abstract) classes. A <i>service
45 * provider</i> is a specific implementation of a service. The classes in a
47 * in the service itself. Service providers may be installed in an
53 * <p> In this lookup mechanism a service is represented by an interface or an
55 * recommended.) A provider of a given service contains one or more concrete
56 * classes that extend this <i>service class</i> with data and code specific to
61 * provider classes tend to be highly service-specific; no single class or
66 * <p> A service provider identifies itself by placing a provider-configuration
68 * should consist of the fully-qualified name of the abstract service class.
83 * <p> <b>Example:</b> Suppose we have a service class named
96 * service then its jar file would contain the file
134 private static void fail(Class service, String msg, Throwable cause)
138 = new ServiceConfigurationError(service.getName() + ": " + msg);
143 private static void fail(Class service, String msg)
146 throw new ServiceConfigurationError(service.getName() + ": " + msg);
149 private static void fail(Class service, URL u, int line, String msg)
152 fail(service, u + ":" + line + ": " + msg);
160 private static int parseLine(Class service, URL u, BufferedReader r, int lc,
174 fail(service, u, lc, "Illegal configuration-file syntax");
177 fail(service, u, lc, "Illegal provider-class name: " + ln);
181 fail(service, u, lc, "Illegal provider-class name: " + ln);
194 * @param service
195 * The service class for which providers are being sought;
214 private static Iterator parse(Class service, URL u, Set returned)
224 while ((lc = parseLine(service, u, r, lc, names, returned)) >= 0);
226 fail(service, ": " + x);
232 fail(service, ": " + y);
244 Class service;
251 private LazyIterator(Class service, ClassLoader loader) {
252 this.service = service;
262 String fullName = prefix + service.getName();
268 fail(service, ": " + x);
275 pending = parse(service, (URL)configs.nextElement(), returned);
291 fail(service,
294 if (!service.isAssignableFrom(c)) {
295 fail(service,
299 return service.cast(c.newInstance());
301 fail(service,
317 * given service using the given class loader.
319 * <p> This method transforms the name of the given service class into a
331 * @param service
332 * The service's abstract service class
341 * service, in some arbitrary order. The iterator will throw a
353 public static Iterator providers(Class service, ClassLoader loader)
356 return new LazyIterator(service, loader);
362 * given service using the context class loader. This convenience method
367 * return Service.providers(service, cl);
370 * @param service
371 * The service's abstract service class
374 * service, in some arbitrary order. The iterator will throw a
385 public static Iterator providers(Class service)
389 return Service.providers(service, cl);
395 * given service using the extension class loader. This convenience method
400 * return Service.providers(service, extClassLoader);
407 * @param service
408 * The service's abstract service class
411 * service, in some arbitrary order. The iterator will throw a
422 public static Iterator installedProviders(Class service)
431 return Service.providers(service, prev);