本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}