当前位置: 首页>>代码示例>>Java>>正文


Java PluginPrerequisite类代码示例

本文整理汇总了Java中org.java.plugin.registry.PluginPrerequisite的典型用法代码示例。如果您正苦于以下问题:Java PluginPrerequisite类的具体用法?Java PluginPrerequisite怎么用?Java PluginPrerequisite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PluginPrerequisite类属于org.java.plugin.registry包,在下文中一共展示了PluginPrerequisite类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: countLoadedPlugins

import org.java.plugin.registry.PluginPrerequisite; //导入依赖的package包/类
private int countLoadedPlugins(PluginDescriptor descriptor, PluginRegistry registry, Set<String> alreadyLoaded)
{
	if( alreadyLoaded.contains(descriptor.getId()) )
	{
		return 0;
	}
	alreadyLoaded.add(descriptor.getId());
	int count = 1;
	Collection<PluginPrerequisite> preList = descriptor.getPrerequisites();
	for( PluginPrerequisite pre : preList )
	{
		String pluginId = pre.getPluginId();
		PluginDescriptor subDesc = registry.getPluginDescriptor(pluginId);
		count += countLoadedPlugins(subDesc, registry, alreadyLoaded);

	}
	return count;
}
 
开发者ID:equella,项目名称:Equella,代码行数:19,代码来源:PluginReport.java

示例2: recursivelyIncludePrerequisites

import org.java.plugin.registry.PluginPrerequisite; //导入依赖的package包/类
@SuppressWarnings("nls")
private void recursivelyIncludePrerequisites(PluginRegistry registry, Set<PluginDescriptor> plugins,
	PluginDescriptor desc, Deque<String> trail, Set<String> disallowed, boolean includeOptional)
{
	trail.push(desc.getId());
	for( PluginPrerequisite ppr : desc.getPrerequisites() )
	{
		PluginDescriptor pprDesc = registry.getPluginDescriptor(ppr.getPluginId());
		if( (includeOptional || !ppr.isOptional()) && !plugins.contains(pprDesc) )
		{
			if( disallowed.contains(pprDesc.getId()) )
			{
				throw new RuntimeException("Plugin " + desc.getId() + " requires banned plugin " + pprDesc.getId()
					+ ", trail is:" + trail);
			}
			plugins.add(pprDesc);
			recursivelyIncludePrerequisites(registry, plugins, pprDesc, trail, disallowed, includeOptional);
		}

	}
	trail.pop();
}
 
开发者ID:equella,项目名称:Equella,代码行数:23,代码来源:AbstractPluginService.java

示例3: getDependents

import org.java.plugin.registry.PluginPrerequisite; //导入依赖的package包/类
private synchronized List<PluginBeanLocator> getDependents()
{
	if( dependentLocators == null )
	{
		Set<String> seenPlugins = new HashSet<String>();
		PluginDescriptor descriptor = extension.getDeclaringPluginDescriptor();
		ImmutableList.Builder<PluginBeanLocator> builder = ImmutableList.builder();
		for( PluginPrerequisite preRequisite : descriptor.getPrerequisites() )
		{
			String depId = preRequisite.getPluginId();
			getSecondLevelDependents(depId, seenPlugins, builder);
		}
		dependentLocators = builder.build();
	}
	return dependentLocators;
}
 
开发者ID:equella,项目名称:Equella,代码行数:17,代码来源:GuicePlugin.java

示例4: getSecondLevelDependents

import org.java.plugin.registry.PluginPrerequisite; //导入依赖的package包/类
private void getSecondLevelDependents(String pluginId, Set<String> seenPlugins,
	ImmutableList.Builder<PluginBeanLocator> builder)
{
	if( seenPlugins.contains(pluginId) )
	{
		return;
	}
	seenPlugins.add(pluginId);
	PluginBeanLocator beanLocator = privatePluginService.getBeanLocator(pluginId);
	if( beanLocator != null )
	{
		builder.add(beanLocator);
	}
	PluginDescriptor descriptor = privatePluginService.getPluginDescriptor(pluginId);
	Collection<PluginPrerequisite> prerequisites = descriptor.getPrerequisites();
	for( PluginPrerequisite pluginPrerequisite : prerequisites )
	{
		if( pluginPrerequisite.isExported() )
		{
			getSecondLevelDependents(pluginPrerequisite.getPluginId(), seenPlugins, builder);
		}
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:24,代码来源:GuicePlugin.java

示例5: collectPrerequisites

import org.java.plugin.registry.PluginPrerequisite; //导入依赖的package包/类
private static void collectPrerequisites(PluginDescriptor descr, Set<PluginDescriptor> result, PluginRegistry registry) {
	for (PluginPrerequisite pre : descr.getPrerequisites()) {
		if (!pre.matches()) {
			continue;
		}
		PluginDescriptor descriptor = registry.getPluginDescriptor(pre.getPluginId());
		if (result.add(descriptor)) {
			collectPrerequisites(descriptor, result, registry);
		}
	}
}
 
开发者ID:drftpd-ng,项目名称:drftpd3,代码行数:12,代码来源:PluginTools.java

示例6: collectPluginPrerequisites

import org.java.plugin.registry.PluginPrerequisite; //导入依赖的package包/类
private void collectPluginPrerequisites(PluginDescriptor descr, Set<PluginDescriptor> result, PluginRegistry registry) {
	for (PluginPrerequisite pre : descr.getPrerequisites()) {
		if (!pre.matches()) {
			continue;
		}
		PluginDescriptor descriptor = registry.getPluginDescriptor(pre.getPluginId());
		if (result.add(descriptor)) {
			collectPluginPrerequisites(descriptor, result, registry);
		}
	}
}
 
开发者ID:drftpd-ng,项目名称:drftpd3,代码行数:12,代码来源:SiteManagementHandler.java


注:本文中的org.java.plugin.registry.PluginPrerequisite类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。