當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。