本文整理汇总了Java中net.xeoh.plugins.base.util.PluginManagerUtil类的典型用法代码示例。如果您正苦于以下问题:Java PluginManagerUtil类的具体用法?Java PluginManagerUtil怎么用?Java PluginManagerUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PluginManagerUtil类属于net.xeoh.plugins.base.util包,在下文中一共展示了PluginManagerUtil类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPlugins
import net.xeoh.plugins.base.util.PluginManagerUtil; //导入依赖的package包/类
private List<P> getPlugins(String[] pluginFolders) {
PluginManager pm = PluginManagerFactory.createPluginManager();
pm.addPluginsFrom(ClassURI.CLASSPATH, new OptionReportAfter());
Arrays.asList(pluginFolders).stream().forEach(folder -> {
pm.addPluginsFrom(new File(folder).toURI(), new OptionReportAfter());
});
PluginManagerUtil pmu= new PluginManagerUtil(pm);
return pmu.getPlugins(Plugin.class).stream().filter(selector).map(p->(P)p).collect(Collectors.toList());
}
开发者ID:AI-12,项目名称:A-Fucking-AI,代码行数:10,代码来源:CompetitionGUI.java
示例2: loadPlugins
import net.xeoh.plugins.base.util.PluginManagerUtil; //导入依赖的package包/类
@Override
public <T extends Plugin> List<T> loadPlugins(Class<T> cls) {
// register plugins from plugins directory
PluginManager pm = PluginManagerFactory.createPluginManager();
pm.addPluginsFrom(new File("." + File.separator + "plugins").toURI());
PluginManagerUtil pmu = new PluginManagerUtil(pm);
ArrayList<T> ret = new ArrayList<T>();
Collection<T> plugins = pmu.getPlugins(cls);
if(plugins!=null){
ret.addAll(plugins);
}
return ret;
}
开发者ID:PGWelch,项目名称:com.opendoorlogistics,代码行数:14,代码来源:ODLApiImpl.java
示例3: registerPluginDirectory
import net.xeoh.plugins.base.util.PluginManagerUtil; //导入依赖的package包/类
public static PluginManagerUtil registerPluginDirectory(File dir) {
PluginManager pm = PluginManagerFactory.createPluginManager();
pm.addPluginsFrom(dir.toURI());
PluginManagerUtil pmu = new PluginManagerUtil(pm);
for(ODLComponent component : pmu.getPlugins(ODLComponent.class)){
logger.info("Found component " + component.getId() + " in directory " + dir.getAbsolutePath());
register(component);
}
return pmu;
}
开发者ID:PGWelch,项目名称:com.opendoorlogistics,代码行数:11,代码来源:ODLGlobalComponents.java
示例4: OSAFTView
import net.xeoh.plugins.base.util.PluginManagerUtil; //导入依赖的package包/类
public OSAFTView(String title, PluginManagerUtil pmu) {
super(title);
this.pmu = pmu;
progressDialog = new JDialog(this, "Executing ADB command", false);
viewPluginList = new ArrayList<ViewPlugin>();
pluginButtonList = new ArrayList<JButton>();
actualCurrentCaseLabel = new JLabel("No folder chosen");
controller = new OSAFTController(this);
generalInformationButtonPosition = 0;
initGUI();
controller.setCurrentDevice(devicesCombo.getSelectedItem().toString());
}
开发者ID:j-koenig,项目名称:osaft,代码行数:15,代码来源:OSAFTView.java
示例5: getPlugins
import net.xeoh.plugins.base.util.PluginManagerUtil; //导入依赖的package包/类
private static <P extends ConstellioPlugin> List<P> getPlugins(Class<P> pluginClass, boolean onlyDefault) {
List<P> matches = new ArrayList<P>();
P defaultPlugin = null;
initPluginManager();
PluginManagerUtil pmu = new PluginManagerUtil(pm);
for (P impl : pmu.getPlugins(pluginClass)) {
// ClassLoader classLoader = impl.getClass().getClassLoader();
// classLoaders.add(classLoader);
if (DefaultConstellioPlugin.NAME.equals(impl.getName())) {
defaultPlugin = impl;
} else if (!onlyDefault) {
matches.add(impl);
}
}
if (matches.isEmpty()) {
if (defaultPlugin != null) {
matches.add(defaultPlugin);
}
} else {
// If many plugins are found, they are sorted in the order they are configured in constellio.xml
// (the last has priority over the previous)
Collections.sort(matches, new Comparator<ConstellioPlugin>() {
@Override
public int compare(ConstellioPlugin o1, ConstellioPlugin o2) {
List<String> availablePluginNames = ConstellioSpringUtils.getAvailablePluginNames();
Integer indexOfPluginName1 = availablePluginNames.indexOf(o1.getName());
Integer indexOfPluginName2 = availablePluginNames.indexOf(o2.getName());
return indexOfPluginName1.compareTo(indexOfPluginName2);
}
});
}
return matches;
}
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:35,代码来源:PluginFactory.java
示例6: getPlugins
import net.xeoh.plugins.base.util.PluginManagerUtil; //导入依赖的package包/类
/**
* Get plugins
*/
public <P extends Plugin> List<P> getPlugins(final Class<P> plugin) {
PluginManagerUtil pmu = new PluginManagerUtil(pm);
return new ArrayList<P>(pmu.getPlugins(plugin));
}
开发者ID:openkm,项目名称:document-management-system,代码行数:8,代码来源:ExtensionManager.java
示例7: PluginInstantiator
import net.xeoh.plugins.base.util.PluginManagerUtil; //导入依赖的package包/类
/** Ctor: Initializes the simple plugin framework, private to force singleton paradigm. */
private PluginInstantiator() {
implMap = createImplementationMap(null);
pm = PluginManagerFactory.createPluginManager();
util = new PluginManagerUtil(pm);
}
开发者ID:Angerona,项目名称:angerona-framework,代码行数:7,代码来源:PluginInstantiator.java
示例8: getPluginUtil
import net.xeoh.plugins.base.util.PluginManagerUtil; //导入依赖的package包/类
/** @return the utility class of the plugin API to load plugins ect. */
public PluginManagerUtil getPluginUtil() {
return util;
}
开发者ID:Angerona,项目名称:angerona-framework,代码行数:5,代码来源:PluginInstantiator.java
注:本文中的net.xeoh.plugins.base.util.PluginManagerUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论