< prev index next >

src/java.base/share/classes/java/util/ServiceLoader.java

Print this page
rev 51958 : 8211122: Reduce the number of internal classes made accessible to jdk.unsupported
Reviewed-by: alanb, dfuchs, kvn


  30 import java.io.InputStream;
  31 import java.io.InputStreamReader;
  32 import java.lang.reflect.Constructor;
  33 import java.lang.reflect.InvocationTargetException;
  34 import java.lang.reflect.Method;
  35 import java.lang.reflect.Modifier;
  36 import java.net.URL;
  37 import java.net.URLConnection;
  38 import java.security.AccessControlContext;
  39 import java.security.AccessController;
  40 import java.security.PrivilegedAction;
  41 import java.security.PrivilegedActionException;
  42 import java.security.PrivilegedExceptionAction;
  43 import java.util.function.Consumer;
  44 import java.util.function.Supplier;
  45 import java.util.stream.Stream;
  46 import java.util.stream.StreamSupport;
  47 
  48 import jdk.internal.loader.BootLoader;
  49 import jdk.internal.loader.ClassLoaders;
  50 import jdk.internal.misc.JavaLangAccess;
  51 import jdk.internal.misc.SharedSecrets;
  52 import jdk.internal.misc.VM;
  53 import jdk.internal.module.ServicesCatalog;
  54 import jdk.internal.module.ServicesCatalog.ServiceProvider;
  55 import jdk.internal.reflect.CallerSensitive;
  56 import jdk.internal.reflect.Reflection;
  57 
  58 
  59 /**
  60  * A facility to load implementations of a service.
  61  *
  62  * <p> A <i>service</i> is a well-known interface or class for which zero, one,
  63  * or many service providers exist. A <i>service provider</i> (or just
  64  * <i>provider</i>) is a class that implements or subclasses the well-known
  65  * interface or class. A {@code ServiceLoader} is an object that locates and
  66  * loads service providers deployed in the run time environment at a time of an
  67  * application's choosing. Application code refers only to the service, not to
  68  * service providers, and is assumed to be capable of differentiating between
  69  * multiple service providers as well as handling the possibility that no service
  70  * providers are located.
  71  *




  30 import java.io.InputStream;
  31 import java.io.InputStreamReader;
  32 import java.lang.reflect.Constructor;
  33 import java.lang.reflect.InvocationTargetException;
  34 import java.lang.reflect.Method;
  35 import java.lang.reflect.Modifier;
  36 import java.net.URL;
  37 import java.net.URLConnection;
  38 import java.security.AccessControlContext;
  39 import java.security.AccessController;
  40 import java.security.PrivilegedAction;
  41 import java.security.PrivilegedActionException;
  42 import java.security.PrivilegedExceptionAction;
  43 import java.util.function.Consumer;
  44 import java.util.function.Supplier;
  45 import java.util.stream.Stream;
  46 import java.util.stream.StreamSupport;
  47 
  48 import jdk.internal.loader.BootLoader;
  49 import jdk.internal.loader.ClassLoaders;
  50 import jdk.internal.access.JavaLangAccess;
  51 import jdk.internal.access.SharedSecrets;
  52 import jdk.internal.misc.VM;
  53 import jdk.internal.module.ServicesCatalog;
  54 import jdk.internal.module.ServicesCatalog.ServiceProvider;
  55 import jdk.internal.reflect.CallerSensitive;
  56 import jdk.internal.reflect.Reflection;
  57 
  58 
  59 /**
  60  * A facility to load implementations of a service.
  61  *
  62  * <p> A <i>service</i> is a well-known interface or class for which zero, one,
  63  * or many service providers exist. A <i>service provider</i> (or just
  64  * <i>provider</i>) is a class that implements or subclasses the well-known
  65  * interface or class. A {@code ServiceLoader} is an object that locates and
  66  * loads service providers deployed in the run time environment at a time of an
  67  * application's choosing. Application code refers only to the service, not to
  68  * service providers, and is assumed to be capable of differentiating between
  69  * multiple service providers as well as handling the possibility that no service
  70  * providers are located.
  71  *


< prev index next >