Package com.iizix.server
Class PluginLoader
java.lang.Object
com.iizix.server.PluginLoader
The plug-in loader class checking for plug-in dependencies in a Module project.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorDescriptionPluginLoader
(PropFactory factory, ClassLoader classLoader) Creates the instance.Method Summary
Modifier and TypeMethodDescriptioncreateClassLoader
(ClassLoader parentClassLoader) Creates a new classloader that also handles loading classes from the added plugins.Gets the comma-separated list of loaded plugins.loadPlugins
(String names) Loads required plug-in's.
Constructor Details
PluginLoader
Creates the instance.- Parameters:
factory
- The factory to register the plug-ins in.classLoader
- The ClassLoader to use when running in a Server environment.
Method Details
loadPlugins
Loads required plug-in's.Each plug-in must have a class called "name.server.Descriptor" that implement the interface
com.iizix.IPluginDescriptor
available.The plug-in definition should be found at the "name/schema/properties.xml", but the iiziGo modules have the "iizigo" module instead of "iizix". To figure out translation of names, a class called "name.server.Descriptor" is loaded and should implement the interface
- Parameters:
names
- The plug-in name, e.g. "com.iizigo.db,com.iizigo.term,com.iizigo.ws".- Returns:
- The list of plug-in descriptors.
- Throws:
IOException
- If a plug-in failed to load.
getLoadedPlugins
Gets the comma-separated list of loaded plugins.- Returns:
- The comma-separated list of loaded plugins, empty string for none.
createClassLoader
Creates a new classloader that also handles loading classes from the added plugins.- Parameters:
parentClassLoader
- The parent class loaders, must be defined.- Returns:
- A new class loader.