Class PluginManager
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
ca.phon.plugin.PluginManager
- All Implemented Interfaces:
Closeable,AutoCloseable
Reads the plugin def xml files and provides methods
for adding plugin defined menu entries to window menus.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClassLoader(ClassLoader classloader) voidAdd a zip/jar file to the dynamic class loadervoidgetEntryPoint(String name) Get the entry point identified by the given plugin id.Get entry point names<T> List<IPluginExtensionPoint<T>> getExtensionPoints(Class<T> clazz) Get the extension points for the given class.<T> List<T> getExtensions(Class<T> clazz) Get initilized extension points for the given class.static PluginManagerGet singleton instancegetResource(String name) getResource(String name, boolean deep) getResourceAsStream(String name) getResourceAsStream(String name, boolean deep) getResources(String name) getResources(String name, boolean deep) voidremoveClassLoader(ClassLoader classloader) voidTell the plugin manager to scan plugins folder.voidscanPluginFolder(File pluginFolder) Methods inherited from class java.net.URLClassLoader
close, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Field Details
-
PLUGIN_FOLDER
-
-
Method Details
-
getInstance
Get singleton instance -
addClassLoader
-
removeClassLoader
-
scanPluginFolder
public void scanPluginFolder()Tell the plugin manager to scan plugins folder. -
scanPluginFolder
-
addFile
Add a zip/jar file to the dynamic class loader- Parameters:
path-- Throws:
MalformedURLException
-
addURL
- Overrides:
addURLin classURLClassLoader
-
getResource
- Overrides:
getResourcein classClassLoader
-
getResource
-
getResources
- Overrides:
getResourcesin classClassLoader- Throws:
IOException
-
getResources
- Throws:
IOException
-
getResourceAsStream
- Overrides:
getResourceAsStreamin classURLClassLoader
-
getResourceAsStream
-
getEntryPoints
-
getEntryPoint
Get the entry point identified by the given plugin id.- Parameters:
name- the name of the entry point to retrieve- Returns:
- the plugin entry point or NULL if not found
-
getExtensions
Get initilized extension points for the given class. This method should only be used when there is a default constructor available for the given class.- Parameters:
clazz-- Throws:
PluginException- if there is a problem with creating the list of objects.
-
getExtensionPoints
Get the extension points for the given class.- Parameters:
clazz- the class for extensions- Returns:
- the list of loaded extension points for the given class
-