Udostępnij za pośrednictwem


ServiceLoader.LoadInstalled(Class) Method

Definition

Creates a new service loader for the given service type, using the extension class loader.

[Android.Runtime.Register("loadInstalled", "(Ljava/lang/Class;)Ljava/util/ServiceLoader;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "S" })]
public static Java.Util.ServiceLoader? LoadInstalled (Java.Lang.Class? service);
[<Android.Runtime.Register("loadInstalled", "(Ljava/lang/Class;)Ljava/util/ServiceLoader;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "S" })>]
static member LoadInstalled : Java.Lang.Class -> Java.Util.ServiceLoader

Parameters

service
Class

The interface or abstract class representing the service

Returns

A new service loader

Attributes

Remarks

Creates a new service loader for the given service type, using the extension class loader.

This convenience method simply locates the extension class loader, call it extClassLoader, and then returns

<blockquote>

ServiceLoader.load(<i>service</i>, <i>extClassLoader</i>)

</blockquote>

If the extension class loader cannot be found then the system class loader is used; if there is no system class loader then the bootstrap class loader is used.

This method is intended for use when only installed providers are desired. The resulting service will only find and load providers that have been installed into the current Java virtual machine; providers on the application's class path will be ignored.

Java documentation for java.util.ServiceLoader.loadInstalled(java.lang.Class<S>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to