java.lang.Object
net.foxgenesis.watame.plugin.UntrustedPluginLoader<T>
-
Constructor Summary
ConstructorsConstructorDescriptionUntrustedPluginLoader(Class<T> pluginClass) Create a newUntrustedPluginLoaderinstance using the provided service class. -
Method Summary
Modifier and TypeMethodDescriptionGet the class ofUntrustedPluginLoader.Get all plugins of typeUntrustedPluginLoaderin the selected folder.getPlugins(Function<ServiceLoader.Provider<T>, T> providerMap) Get all plugins of typeUntrustedPluginLoaderin the selected folder.voidreload()Clear this loader's provider cache so that all providers will be reloaded.
-
Constructor Details
-
UntrustedPluginLoader
Create a newUntrustedPluginLoaderinstance using the provided service class.- Parameters:
pluginClass- - service class used to load plugins- Throws:
NullPointerException- ifpluginClassisnull
-
-
Method Details
-
getPlugins
Get all plugins of typeUntrustedPluginLoaderin the selected folder.This method is effectively equivalent to:
getPlugins(Provider::get)
- Returns:
- A
CollectionofUntrustedPluginLoader - Throws:
ServiceConfigurationError- if the service type is not accessible to the caller or the caller is in an explicit module and its module descriptor does not declare that it uses service- See Also:
-
getPlugins
Get all plugins of typeUntrustedPluginLoaderin the selected folder.- Parameters:
providerMap- -Functionto map aServiceLoader.ProvidertoUntrustedPluginLoader- Returns:
- A
CollectionofUntrustedPluginLoader - Throws:
ServiceConfigurationError- if the service type is not accessible to the caller or the caller is in an explicit module and its module descriptor does not declare that it uses service- See Also:
-
reload
public void reload()Clear this loader's provider cache so that all providers will be reloaded. -
getPluginClass
Get the class ofUntrustedPluginLoader.- Returns:
-