use of ro.fortsoft.pf4j.PluginFactory in project gitblit by gitblit.
the class PluginManager method start.
@Override
public PluginManager start() {
File dir = runtimeManager.getFileOrFolder(Keys.plugins.folder, "${baseFolder}/plugins");
dir.mkdirs();
pf4j = new DefaultPluginManager(dir) {
@Override
protected PluginFactory createPluginFactory() {
return new GuicePluginFactory();
}
@Override
protected ExtensionFactory createExtensionFactory() {
return new GuiceExtensionFactory();
}
};
try {
Version systemVersion = Version.createVersion(Constants.getVersion());
pf4j.setSystemVersion(systemVersion);
} catch (Exception e) {
logger.error(null, e);
}
pf4j.loadPlugins();
logger.debug("Starting plugins");
pf4j.startPlugins();
return this;
}
Aggregations