ServiceLoader.Load Method

Definition

Overloads

Load(Class)

Creates a new service loader for the given service type, using the current thread's java.

Load(Class, ClassLoader)

Creates a new service loader for the given service type and class loader.

Load(Class)

Creates a new service loader for the given service type, using the current thread's java.

[Android.Runtime.Register("load", "(Ljava/lang/Class;)Ljava/util/ServiceLoader;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "S" })]
public static Java.Util.ServiceLoader? Load (Java.Lang.Class? service);
[<Android.Runtime.Register("load", "(Ljava/lang/Class;)Ljava/util/ServiceLoader;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "S" })>]
static member Load : 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 current thread's java.lang.Thread#getContextClassLoader context class loader.

An invocation of this convenience method of the form

<blockquote>

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

</blockquote>

is equivalent to

<blockquote>

ServiceLoader.load(<i>service</i>,
                               Thread.currentThread().getContextClassLoader())

</blockquote>

Java documentation for java.util.ServiceLoader.load(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

Load(Class, ClassLoader)

Creates a new service loader for the given service type and class loader.

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

Parameters

service
Class

The interface or abstract class representing the service

loader
ClassLoader

The class loader to be used to load provider-configuration files and provider classes, or null if the system class loader (or, failing that, the bootstrap class loader) is to be used

Returns

A new service loader

Attributes

Remarks

Creates a new service loader for the given service type and class loader.

Java documentation for java.util.ServiceLoader.load(java.lang.Class<S>, java.lang.ClassLoader).

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