public class PluginLoader extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PluginLoader.PluginClassLoader |
static class |
PluginLoader.PluginLoaderEvent |
static interface |
PluginLoader.PluginLoaderListener |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NEWER_JAVA_REQUIRED |
static java.lang.String |
PLUGIN_KERNEL_PACKAGE |
static java.lang.String |
PLUGIN_PACKAGE |
static java.lang.String |
PLUGIN_PATH |
Modifier and Type | Method and Description |
---|---|
static void |
addListener(PluginLoader.PluginLoaderListener listener)
Add a listener
|
static void |
checkPlugins(boolean showProgress)
Check for missing plugins and install them if needed.
|
static java.util.ArrayList<PluginDescriptor> |
getActionablePlugins()
Return the list of "actionable" plugins (mean we can launch them from GUI).
|
static java.util.ArrayList<PluginDescriptor> |
getActionablePlugins(boolean wantBundled)
Return the list of "actionable" plugins (mean we can launch them from GUI).
|
static java.util.ArrayList<PluginDaemon> |
getActiveDaemons()
Returns the list of active daemon plugins.
|
static java.util.Map<java.lang.String,java.lang.Class<?>> |
getAllClasses()
Deprecated.
Use
getLoadedClasses() instead as we load classes on demand. |
static java.util.Map<java.lang.String,java.net.URL> |
getAllResources()
Return all resources present in the Plugin class loader.
|
static java.util.ArrayList<PluginDescriptor> |
getDaemonPlugins()
Returns the list of daemon type plugins.
|
static java.util.Map<java.lang.String,java.lang.Class<?>> |
getLoadedClasses()
Return all loaded classes.
|
static java.util.Map<java.lang.String,byte[]> |
getLoadedResources()
Return content of all loaded resources.
|
static java.lang.ClassLoader |
getLoader()
Return the loader
|
static boolean |
getLogError()
Deprecated.
|
static PluginDescriptor |
getPlugin(PluginDescriptor.PluginIdent ident,
boolean acceptNewer)
Returns the plugin corresponding to the specified plugin identity structure.
|
static PluginDescriptor |
getPlugin(java.lang.String className)
Returns the plugin corresponding to the specified plugin class name.
|
static java.lang.Class<? extends Plugin> |
getPluginClass(java.lang.String className)
Returns the plugin class corresponding to the specified plugin class name.
|
static java.util.ArrayList<PluginDescriptor> |
getPlugins()
Return the list of loaded plugins.
|
static java.util.ArrayList<PluginDescriptor> |
getPlugins(boolean wantBundled)
Return the list of loaded plugins.
|
static java.util.ArrayList<PluginDescriptor> |
getPlugins(java.lang.Class<?> clazz)
Return the list of loaded plugins which derive from the specified class.
|
static java.util.ArrayList<PluginDescriptor> |
getPlugins(java.lang.Class<?> clazz,
boolean wantBundled,
boolean wantAbstract,
boolean wantInterface)
Return the list of loaded plugins which derive from the specified class.
|
static java.io.InputStream |
getResourceAsStream(java.lang.String name)
Return a resource as data stream from given resource name
|
static boolean |
isJCLDisabled()
Load all classes from specified path
|
static boolean |
isLoaded(PluginDescriptor plugin,
boolean acceptNewer)
Returns
true if the specified plugin exists in the PluginLoader . |
static boolean |
isLoaded(java.lang.String className)
Returns
true if the specified plugin class exists in the PluginLoader . |
static boolean |
isLoading() |
static java.lang.Class<?> |
loadClass(java.lang.String className)
Try to load and returns the specified class from the
PluginLoader . |
static void |
reload()
Reload the list of installed plugins (wait for completion).
|
static void |
reload(boolean forceNow)
Deprecated.
Use
reload() instead. |
static void |
reloadAsynch()
Reload the list of installed plugins (asynchronous version).
|
static void |
removeListener(PluginLoader.PluginLoaderListener listener)
Remove a listener
|
static void |
resetDaemons()
Stop and restart all daemons plugins.
|
static void |
setJCLDisabled(boolean value) |
static void |
setLogError(boolean value)
Deprecated.
|
static void |
stopDaemons()
Stop daemons plugins.
|
static java.lang.String |
verifyPlugin(PluginDescriptor plugin)
Verify the specified plugin is correctly installed.
|
static void |
waitWhileLoading()
wait until loading completed
|
public static final java.lang.String PLUGIN_PACKAGE
public static final java.lang.String PLUGIN_KERNEL_PACKAGE
public static final java.lang.String PLUGIN_PATH
public static final java.lang.String NEWER_JAVA_REQUIRED
public static void reloadAsynch()
public static void reload()
public static void resetDaemons()
public static java.util.ArrayList<PluginDescriptor> getDaemonPlugins()
public static java.util.ArrayList<PluginDaemon> getActiveDaemons()
public static void stopDaemons()
public static java.lang.ClassLoader getLoader()
public static java.util.Map<java.lang.String,java.net.URL> getAllResources()
public static java.util.Map<java.lang.String,byte[]> getLoadedResources()
public static java.util.Map<java.lang.String,java.lang.Class<?>> getLoadedClasses()
@Deprecated public static java.util.Map<java.lang.String,java.lang.Class<?>> getAllClasses()
getLoadedClasses()
instead as we load classes on demand.public static java.io.InputStream getResourceAsStream(java.lang.String name)
name
- resource namepublic static java.util.ArrayList<PluginDescriptor> getPlugins()
public static java.util.ArrayList<PluginDescriptor> getPlugins(boolean wantBundled)
wantBundled
- specify if we also want plugin implementing the PluginBundled
interface.public static java.util.ArrayList<PluginDescriptor> getPlugins(java.lang.Class<?> clazz)
clazz
- The class object defining the class we want plugin derive from.public static java.util.ArrayList<PluginDescriptor> getPlugins(java.lang.Class<?> clazz, boolean wantBundled, boolean wantAbstract, boolean wantInterface)
clazz
- The class object defining the class we want plugin derive from.wantBundled
- specify if we also want plugin implementing the PluginBundled
interfacewantAbstract
- specify if we also want abstract classeswantInterface
- specify if we also want interfacespublic static java.util.ArrayList<PluginDescriptor> getActionablePlugins(boolean wantBundled)
wantBundled
- specify if we also want plugin implementing the PluginBundled
interfacepublic static java.util.ArrayList<PluginDescriptor> getActionablePlugins()
PluginBundled
interface are also returned.public static boolean isLoading()
public static void waitWhileLoading()
public static boolean isLoaded(PluginDescriptor plugin, boolean acceptNewer)
true
if the specified plugin exists in the PluginLoader
.plugin
- the plugin we are looking for.acceptNewer
- allow newer version of the pluginpublic static boolean isLoaded(java.lang.String className)
true
if the specified plugin class exists in the PluginLoader
.className
- class name of the plugin we are looking for.public static PluginDescriptor getPlugin(PluginDescriptor.PluginIdent ident, boolean acceptNewer)
null
if the plugin does not exists in the PluginLoader
.ident
- plugin identityacceptNewer
- allow newer version of the pluginpublic static PluginDescriptor getPlugin(java.lang.String className)
null
if the plugin does not exists in the PluginLoader
.className
- class name of the plugin we are looking for.public static java.lang.Class<? extends Plugin> getPluginClass(java.lang.String className)
null
if the plugin does not exists in the PluginLoader
.className
- class name of the plugin we are looking for.public static java.lang.Class<?> loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
PluginLoader
.getLoader()
then call
loadClass(String)
method from it.className
- class name of the class we want to load.java.lang.ClassNotFoundException
public static java.lang.String verifyPlugin(PluginDescriptor plugin)
public static boolean isJCLDisabled()
public static void setJCLDisabled(boolean value)
@Deprecated public static boolean getLogError()
@Deprecated public static void setLogError(boolean value)
public static void checkPlugins(boolean showProgress)
public static void addListener(PluginLoader.PluginLoaderListener listener)
listener
- public static void removeListener(PluginLoader.PluginLoaderListener listener)
listener
-