• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BundleDescription类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: addBundle

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
private Bundle addBundle(Version version, String id) {
	Manifest manifest = version.findManifest(id);
	if (manifest != null) {
		if (manifest instanceof Bundle)
			return (Bundle) manifest;
		else
			return null;
	}
	Bundle bundle = ModelFactory.eINSTANCE.createBundle();
	bundle.setId(id);
	version.getBundles().add(bundle);

	IPluginModelBase entry = PDECore.getDefault().getModelManager().findModel(id);
	if (entry != null) {
		BundleDescription bundleDescription = entry.getBundleDescription();
		bundle.setName(bundleDescription.getName());
		bundle.setVendor(bundleDescription.getSupplier().getName());
		bundle.setVersion(bundleDescription.getVersion().toString());
	}
	return bundle;
}
 
开发者ID:wimjongman,项目名称:FDE,代码行数:22,代码来源:WorkspaceImport.java


示例2: addFragment

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
private Fragment addFragment(Version version, String Id) {
		Manifest manifest = version.findManifest(Id);
		if (manifest != null) {
			if (manifest instanceof Fragment)
				return (Fragment) manifest;
			else
				return null;
		}
		Fragment fragment = ModelFactory.eINSTANCE.createFragment();
		fragment.setId(Id);
		version.getFragments().add(fragment);

		IPluginModelBase entry = PDECore.getDefault().getModelManager().findModel(Id);

		if (entry != null) {
			BundleDescription bundleDescription = entry.getBundleDescription().getHost()
.getHosts()[0];
			Bundle bundle = addBundle(version, bundleDescription.getSymbolicName());
			fragment.setName(bundleDescription.getName());
			fragment.setParentBundle(bundle);
			fragment.setVendor(bundleDescription.getSupplier().getName());
			fragment.setVersion(bundleDescription.getVersion().toString());
		}
		return fragment;
	}
 
开发者ID:wimjongman,项目名称:FDE,代码行数:26,代码来源:WorkspaceImport.java


示例3: populateStartupStateModel

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
/**
 * Populates the startup state model with the {@link BundleDescriptions} of
 * the bundles found in the startup configuration.
 */
protected void populateStartupStateModel() {
    final File rootBundleDir = getParent().getPluginRootDirectory().toFile();
    for (Object o : getProperties().keySet()) {
        // In karaf-3.0.0, mvn urls are sored instead of raw paths.
        // Then first try to convert mvn urls to raw path.
        final File bundleLocation = new File(rootBundleDir, getPath((String) o));

        final BundleDescription desc = getParent().getState().getBundleByLocation(
                bundleLocation.getAbsolutePath());

        if (desc == null) {
            KarafCorePluginActivator.getLogger().error(
                    "Unable to locate bundle description for: "
                            + bundleLocation.getAbsolutePath());
        } else {
            final BundleStartEntry se = new BundleStartEntry(desc, (String) getProperties()
                    .get(o));
            startupStateModel.put(desc.getSymbolicName(), se);

        }
    }
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:27,代码来源:StartupSectionImpl.java


示例4: getColumnName

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
private String getColumnName(IPluginModelBase pm)
{
	BundleDescription bundleDescription = pm.getBundleDescription();
	String pluginName = (bundleDescription != null) ? bundleDescription.getName() : "NO NAME ???";
	for (String prefix : prefixFilters)
	{
		if (pluginName.startsWith(prefix))
		{
			if (prefix.length() < pluginName.length())
			{
				pluginName = pluginName.substring(prefix.length());
				// Adjust to remove the first '.' if present
				if ((pluginName.startsWith(".")) && pluginName.length() > 2)
					pluginName = pluginName.substring(1);
			}
			break;
		}
	}
	return pluginName;
}
 
开发者ID:opcoach,项目名称:E34MigrationTooling,代码行数:21,代码来源:MigrationStatsE4View.java


示例5: resolve

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
State resolve(List<SimpleManifest> manifests) {

		State state = factory.createState(true);

		// Create bundle descriptions from our manifests
		BundleDescription[] descriptions = new BundleDescription[manifests
				.size()];
		for (int i = 0; i < descriptions.length; i++) {
			Dictionary<String, String> dict = manifests.get(i).toDictionary();
			try {
				descriptions[i] = factory.createBundleDescription(state, dict,
						Integer.toString(i), i);
			} catch (BundleException e) {
				handleBundleException(e, manifests.get(i));
				continue;
			}
			state.addBundle(descriptions[i]);
		}

		// This does the work...
		state.resolve();

		return state;
	}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:25,代码来源:Resolver.java


示例6: fillWithDependent

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
private void fillWithDependent(LinkedList<BundleDescription> bundleDescriptions) {
	HashSet<String> added = new HashSet<String>();
	for (BundleDescription bundleDescription : new LinkedList<BundleDescription>(bundleDescriptions) )  {
		//BundleSpecification[] deps = bundleDescription.getRequiredBundles();
		// for (BundleSpecification depSpec : deps) {
			// if ( depDescription.getSymbolicName().contains("commons.logging") ) 
			// 	break;
			
			// BundleDescription depDescription = depSpec.getBundle();
		BundleDescription deps[] = bundleDescription.getResolvedRequires();
		for(BundleDescription depDescription : deps) {
			if ( ! added.contains( depDescription.getSymbolicName() )) {
				bundleDescriptions.add( depDescription );
				added.add( depDescription.getSymbolicName() );
			}
		}
	}
	
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:20,代码来源:EclecticClasspathContainerInitializer.java


示例7: getSymbolicName

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
private String getSymbolicName(String bundleUrl) {
	File bundlePath = new File(baseBundlesDir, converter.getPath(bundleUrl));
	BundleDescription bundleDescription = karafPlatformModel.getState().getBundleByLocation(bundlePath.getAbsolutePath());
	if (bundleDescription != null) {
		return bundleDescription.getSymbolicName();
	} else {
		return null;
	}
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:10,代码来源:FeaturesBundlesStartLevels.java


示例8: createPluginClassPath

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
private static String[] createPluginClassPath(IJavaProject javaProject) throws CoreException {
    String[] javaClassPath = createJavaClasspath(javaProject);
    IPluginModelBase model = PluginRegistry.findModel(javaProject.getProject());
    if (model == null || model.getPluginBase().getId() == null) {
        return javaClassPath;
    }
    List<String> pdeClassPath = new ArrayList<String>();
    pdeClassPath.addAll(Arrays.asList(javaClassPath));

    BundleDescription target = model.getBundleDescription();

    Set<BundleDescription> bundles = new HashSet<BundleDescription>();
    // target is null if plugin uses non OSGI format
    if (target != null) {
        addDependentBundles(target, bundles);
    }

    // convert default location (relative to wsp) to absolute path
    IPath defaultOutputLocation = ResourceUtils.relativeToAbsolute(javaProject.getOutputLocation());

    for (BundleDescription bd : bundles) {
        appendBundleToClasspath(bd, pdeClassPath, defaultOutputLocation);
    }

    if(defaultOutputLocation != null) {
        String defaultOutput = defaultOutputLocation.toOSString();
        if(pdeClassPath.indexOf(defaultOutput) > 0) {
            pdeClassPath.remove(defaultOutput);
            pdeClassPath.add(0, defaultOutput);
        }
    }
    return pdeClassPath.toArray(new String[pdeClassPath.size()]);
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:34,代码来源:PDEClassPathGenerator.java


示例9: addDependentBundles

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
private static void addDependentBundles(BundleDescription bd, Set<BundleDescription> bundles) {
    // TODO for some reasons, this does not add "native" fragments for the
    // platform. See also: ContributedClasspathEntriesEntry, RequiredPluginsClasspathContainer
    // BundleDescription[] requires = PDEState.getDependentBundles(target);
    BundleDescription[] bundles2 = PDEState.getDependentBundlesWithFragments(bd);
    for (BundleDescription bundleDescription : bundles2) {
        if(bundleDescription == null) {
            continue;
        }
        if (!bundles.contains(bundleDescription)) {
            bundles.add(bundleDescription);
            addDependentBundles(bundleDescription, bundles);
        }
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:16,代码来源:PDEClassPathGenerator.java


示例10: reportResolutionProblems

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
void reportResolutionProblems(State state) {
	boolean resolutionErrors = hasUnresolvedBundles(state);

	BundleDescription[] descriptions = state.getBundles();
	VersionConstraint[] rootcauses = state.getStateHelper()
			.getUnsatisfiedLeaves(descriptions);

	// There may be warnings of unresolved constraints, show errors and
	// warnings
	if (resolutionErrors || rootcauses.length != 0) {
		if (resolutionErrors) {
			System.err.println("ERROR: There were resolution errors");
		} else {
			System.err.println("WARNING: There were resolution warnings");
		}
		System.err.println();

		// Just being cute
		System.err.print("The following ");
		if (rootcauses.length == 1) {
			System.err.println("root cause was identified");
		} else {
			System.err.println(rootcauses.length
					+ " root causes were identified");
		}

		for (VersionConstraint constraint : rootcauses) {
			System.err.print("Could not resolve following constraint in ");
			System.err.println(constraint.getBundle().getName());
			System.err.println("\t" + constraint);
		}
	} else {
		System.out.println("There were no resolution problems.");
	}
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:36,代码来源:Resolver.java


示例11: hasUnresolvedBundles

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
boolean hasUnresolvedBundles(State state) {
	BundleDescription[] descriptions = state.getBundles();
	for (int i = 0; i < descriptions.length; i++) {
		if (!descriptions[i].isResolved()) {
			return true;
		}
	}
	return false;
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:10,代码来源:Resolver.java


示例12: getAllCapabilities

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
private List<BundleCapability> getAllCapabilities(final Bundle[] bundles, final State state) {
  List<BundleCapability> availableCapabilities = new ArrayList<BundleCapability>();
  for (Bundle bundle : bundles) {
    BundleDescription bundleDescription = state.getBundle(bundle.getBundleId());
    List<BundleCapability> declaredCapabilities = bundleDescription.getDeclaredCapabilities(null);
    availableCapabilities.addAll(declaredCapabilities);
  }
  return availableCapabilities;
}
 
开发者ID:everit-org,项目名称:eosgi-maven-plugin,代码行数:10,代码来源:AnalyzeMojo.java


示例13: resolveLibraryInFragments

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
protected static IPluginModelBase resolveLibraryInFragments(IPluginModelBase model, String libraryName) {
    BundleDescription desc = model.getBundleDescription();
    if (desc != null) {
        BundleDescription[] fragments = desc.getFragments();
        for (int i = 0; i < fragments.length; i++) {
            if (new File(fragments[i].getLocation(), libraryName).exists())
                return PluginRegistry.findModel(fragments[i]);
        }
    }
    return null;
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:12,代码来源:EclecticClasspathContainerInitializer.java


示例14: resolve

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
@Override
public void resolve(BundleDescription[] discard, Dictionary<Object, Object>[] platformProperties) {
	preInitialize();
	realResolver.resolve(discard, platformProperties);
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:6,代码来源:PatchedResolver.java


示例15: resolveDynamicImport

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
@Override
public ExportPackageDescription resolveDynamicImport(BundleDescription importingBundle, String requestedPackage) {
	preInitialize();
	return realResolver.resolveDynamicImport(importingBundle, requestedPackage);
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:6,代码来源:PatchedResolver.java


示例16: bundleAdded

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
@Override
public void bundleAdded(BundleDescription bundle) {
	realResolver.bundleAdded(bundle);
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:5,代码来源:PatchedResolver.java


示例17: bundleRemoved

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
@Override
public void bundleRemoved(BundleDescription bundle, boolean pending) {
	realResolver.bundleRemoved(bundle, pending);
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:5,代码来源:PatchedResolver.java


示例18: bundleUpdated

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
@Override
public void bundleUpdated(BundleDescription newDescription, BundleDescription existingDescription, boolean pending) {
	realResolver.bundleUpdated(newDescription, existingDescription, pending);
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:5,代码来源:PatchedResolver.java


示例19: BundleStartEntry

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
BundleStartEntry(BundleDescription desc, String startLevel) {
    this.bundleDescription = desc;
    this.startLevel = startLevel;
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:5,代码来源:StartupSectionImpl.java


示例20: getBundleDescription

import org.eclipse.osgi.service.resolver.BundleDescription; //导入依赖的package包/类
BundleDescription getBundleDescription() {
    return bundleDescription;
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:4,代码来源:StartupSectionImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Fugue384类代码示例发布时间:2022-05-22
下一篇:
Java MonitoringConstants类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap