This is your entry point to and the heart of JSPF. The plugin manager keeps track of all registed plugins and gives you methods to add and query them. You cannot instantiate the PluginManager directly, instead you
create this class the first time by a call to {@link PluginManagerFactory}.createPluginManager()
Afterwards you probably want to add some of your own plugins. During the lifetime of your application there should only be one PluginManager. The PluginManager does not have to be passed to the inside of your plugins, instead, they can request it by the @ {@link InjectPlugin}annotation (i.e, create a field '
public PluginManager manager
' and add the annotation).
There are also a number of default plugins you can retrieve right away (without calling
addPluginsFrom()
explicitly.). These are:
- {@link PluginConfiguration} - enables you to get and set config options
- {@link PluginInformation} - provides meta information about plugins
- {@link InformationBroker} - supports information exchange between plugins while keeping them decoupled
In addition (and after loading the specific plugin) you can also retrieve a RemoteAPI.
The following configuration sub-keys are usually known for this class (see {@link PluginConfiguration}, keys must be set
before createPluginManager() is being called, i.e., set in the {@link JSPFProperties} object!):
- cache.enabled - Specifies if the known plugins should be cached. Specify either {true, false}.
- cache.mode - If we should use strong caching (slow but more accurate) or weak (much faster). Specify either {stong, weak}.
- cache.file - Cache file to use. Specify any relative or absolute file path, file will be created / overwritten.
- classpath.filter.default.enabled - If Java default classpaths (e.g., jre/lib/*) should be filtered. Specify either {true, false}. Might not work on all platforms as expected.
- classpath.filter.default.pattern - Specify what to filter in addition to default classpaths. Specify a list of ';' separated tokens, e.g., "jdk/lib;jre/lib". Will be matched against URL representations, so all \\ will be converted to / (and ' ' might become %20, ...).
- logging.level - Either {OFF, FINEST, FINER, FINE, INFO, WARNING, ALL}. Specifies what to log on the console.
@see PluginManagerUtil
@author Ralf Biedert