Top Description Inners Fields Constructors Methods
com.sun.tools.javac.processing

pack-priv Class ServiceProxy

extends Object
Class Inheritance
Imports
java.io.BufferedReader, .FileNotFoundException, .IOException, .InputStream, .InputStreamReader, java.net.MalformedURLException, .URL

Utility class to determine if a service can be found on the path that might be used to create a class loader.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static void
fail(Class<?> service, String msg)

private static void
fail(Class<?> service, URL u, int line, String msg)

public static boolean
hasService(Class<?> service, URL[] urls)

Return true if a description for at least one service is found in the service configuration files in the given URLs.

private static boolean

Returns:

true if the name of a service is found
parse
(Class<?>
The service class for which providers are being sought; used to construct error detail strings
service
,
URL
The URL naming the configuration file to be parsed
u
)

Parse the content of the given URL as a provider-configuration file.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

prefixback to summary
private static final String prefix

Constructor Detail

ServiceProxyback to summary
pack-priv ServiceProxy()

Method Detail

failback to summary
private static void fail(Class<?> service, String msg) throws ServiceConfigurationError
failback to summary
private static void fail(Class<?> service, URL u, int line, String msg) throws ServiceConfigurationError
hasServiceback to summary
public static boolean hasService(Class<?> service, URL[] urls) throws ServiceConfigurationError

Return true if a description for at least one service is found in the service configuration files in the given URLs.

parseback to summary
private static boolean parse(Class<?> service, URL u) throws ServiceConfigurationError

Parse the content of the given URL as a provider-configuration file.

Parameters
service:Class<?>

The service class for which providers are being sought; used to construct error detail strings

u:URL

The URL naming the configuration file to be parsed

Returns:boolean

true if the name of a service is found

Exceptions
ServiceConfigurationError:
If an I/O error occurs while reading from the given URL, or if a configuration-file format error is detected
com.sun.tools.javac.processing back to summary

pack-priv Class ServiceProxy.ServiceConfigurationError

extends Error
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides java.lang.Error.serialVersionUID.

Constructor Detail

ServiceConfigurationErrorback to summary
pack-priv ServiceConfigurationError(String msg)