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


Java Constants.BUNDLE_VERSION_ATTRIBUTE属性代码示例

本文整理汇总了Java中org.osgi.framework.Constants.BUNDLE_VERSION_ATTRIBUTE属性的典型用法代码示例。如果您正苦于以下问题:Java Constants.BUNDLE_VERSION_ATTRIBUTE属性的具体用法?Java Constants.BUNDLE_VERSION_ATTRIBUTE怎么用?Java Constants.BUNDLE_VERSION_ATTRIBUTE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.osgi.framework.Constants的用法示例。


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

示例1: WrappingTransformer

public WrappingTransformer(ClassTransformer delegate, ServiceReference<?> persistenceProvider) {
    validate(delegate, persistenceProvider);
    this.delegate = delegate;

    Object packages = persistenceProvider.getProperty("org.apache.aries.jpa.container.weaving.packages");
    if (packages instanceof String[]) {
        for (String s : (String[])packages) {
            packageImportsToAdd.add(s);
        }
    } else {
        Bundle provider = persistenceProvider.getBundle();
        String suffix = ";" + Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + "=" + provider.getSymbolicName()
                        + ";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=" + provider.getVersion();

        BundleRevision br = provider.adapt(BundleWiring.class).getRevision();
        for (BundleCapability bc : br.getDeclaredCapabilities(BundleRevision.PACKAGE_NAMESPACE)) {
            packageImportsToAdd.add(bc.getAttributes().get(BundleRevision.PACKAGE_NAMESPACE) + suffix);
        }
    }
}
 
开发者ID:apache,项目名称:aries-jpa,代码行数:20,代码来源:WrappingTransformer.java

示例2: testParseRequireBundleEntryWithSimpleUnquotedVersion

public void testParseRequireBundleEntryWithSimpleUnquotedVersion() throws Exception {
	String version = "1.0.0.a";
	String entry = PKG + ";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=" + version;
	String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
	assertEquals(PKG, result[0]);
	assertEquals(version, result[1]);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:7,代码来源:OsgiHeaderUtilsTest.java

示例3: testParseRequireBundleEntryWithSimpleQuotedVersion

public void testParseRequireBundleEntryWithSimpleQuotedVersion() throws Exception {
	String version = "1.2.3";
	String entry = PKG + ";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version + "\"";
	String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
	assertEquals(PKG, result[0]);
	assertEquals(version, result[1]);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:7,代码来源:OsgiHeaderUtilsTest.java

示例4: testParseRequireBundleEntryWithVersionRange

public void testParseRequireBundleEntryWithVersionRange() throws Exception {
	String version = "[1.0.0,2.0.0a)";
	String entry = PKG + ";" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version + "\"";
	String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
	assertEquals(PKG, result[0]);
	assertEquals(version, result[1]);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:7,代码来源:OsgiHeaderUtilsTest.java

示例5: testParseRequireBundleEntryWithSimpleUnquotedVersionAndExtraAttributes

public void testParseRequireBundleEntryWithSimpleUnquotedVersionAndExtraAttributes() throws Exception {
	String version = "1.0.0.a";
	String entry = PKG + ";visibility:=reexport;" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=" + version
			+ ";resolution:=optional";
	String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
	assertEquals(PKG, result[0]);
	assertEquals(version, result[1]);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:8,代码来源:OsgiHeaderUtilsTest.java

示例6: testParseRequireBundleEntryWithSimpleQuotedVersionAndExtraAttributes

public void testParseRequireBundleEntryWithSimpleQuotedVersionAndExtraAttributes() throws Exception {
	String version = "1.0.0.a";
	String entry = PKG + ";visibility:=reexport;" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version
			+ "\";resolution:=optional";
	String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
	assertEquals(PKG, result[0]);
	assertEquals(version, result[1]);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:8,代码来源:OsgiHeaderUtilsTest.java

示例7: testParseRequireBundleEntryWithVersionRangeAndExtraAttributes

public void testParseRequireBundleEntryWithVersionRangeAndExtraAttributes() throws Exception {
	String version = "[1.0.0,2.0.0a)";
	String entry = PKG + ";visibility:=reexport;" + Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"" + version
			+ "\";resolution:=optional";
	String[] result = OsgiHeaderUtils.parseRequiredBundleString(entry);
	assertEquals(PKG, result[0]);
	assertEquals(version, result[1]);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:8,代码来源:OsgiHeaderUtilsTest.java


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