本文整理汇总了Java中org.jboss.gravia.resource.ManifestBuilder.addIdentityCapability方法的典型用法代码示例。如果您正苦于以下问题:Java ManifestBuilder.addIdentityCapability方法的具体用法?Java ManifestBuilder.addIdentityCapability怎么用?Java ManifestBuilder.addIdentityCapability使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.gravia.resource.ManifestBuilder
的用法示例。
在下文中一共展示了ManifestBuilder.addIdentityCapability方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getModuleHeadersA
import org.jboss.gravia.resource.ManifestBuilder; //导入方法依赖的package包/类
private Dictionary<String,String> getModuleHeadersA() {
ManifestBuilder builder = new ManifestBuilder();
builder.addIdentityCapability(MODULE_A, "1.0.0");
builder.addManifestHeader("Service-Component", "OSGI-INF/org.jboss.test.gravia.runtime.embedded.sub.a.ServiceFactoryB.xml");
ManifestHeadersProvider headersProvider = new ManifestHeadersProvider(builder.getManifest());
return headersProvider.getHeaders();
}
示例2: getModuleHeadersD
import org.jboss.gravia.resource.ManifestBuilder; //导入方法依赖的package包/类
private Dictionary<String,String> getModuleHeadersD() {
ManifestBuilder builder = new ManifestBuilder();
builder.addIdentityCapability(MODULE_C, "1.0.0");
builder.addManifestHeader("Service-Component", "OSGI-INF/org.jboss.test.gravia.runtime.embedded.sub.a.ServiceC.xml");
ManifestHeadersProvider headersProvider = new ManifestHeadersProvider(builder.getManifest());
return headersProvider.getHeaders();
}
示例3: getModuleHeadersD
import org.jboss.gravia.resource.ManifestBuilder; //导入方法依赖的package包/类
private Dictionary<String,String> getModuleHeadersD() {
ManifestBuilder builder = new ManifestBuilder();
builder.addIdentityCapability(MODULE_D, "1.0.0");
builder.addManifestHeader("Service-Component", "OSGI-INF/org.jboss.test.gravia.runtime.embedded.sub.d.ServiceD.xml");
ManifestHeadersProvider headersProvider = new ManifestHeadersProvider(builder.getManifest());
return headersProvider.getHeaders();
}
示例4: getModuleHeadersD1
import org.jboss.gravia.resource.ManifestBuilder; //导入方法依赖的package包/类
private Dictionary<String,String> getModuleHeadersD1() {
ManifestBuilder builder = new ManifestBuilder();
builder.addIdentityCapability(MODULE_D1, "1.0.0");
builder.addManifestHeader("Service-Component", "OSGI-INF/org.jboss.test.gravia.runtime.embedded.sub.d1.ServiceD1.xml");
ManifestHeadersProvider headersProvider = new ManifestHeadersProvider(builder.getManifest());
return headersProvider.getHeaders();
}
示例5: getModuleHeadersA
import org.jboss.gravia.resource.ManifestBuilder; //导入方法依赖的package包/类
private Dictionary<String,String> getModuleHeadersA() {
ManifestBuilder builder = new ManifestBuilder();
builder.addIdentityCapability(MODULE_A, "1.0.0");
builder.addManifestHeader("Service-Component", "OSGI-INF/org.jboss.test.gravia.runtime.embedded.sub.a.ServiceA.xml");
ManifestHeadersProvider headersProvider = new ManifestHeadersProvider(builder.getManifest());
return headersProvider.getHeaders();
}
示例6: getModuleHeadersA1
import org.jboss.gravia.resource.ManifestBuilder; //导入方法依赖的package包/类
private Dictionary<String,String> getModuleHeadersA1() {
ManifestBuilder builder = new ManifestBuilder();
builder.addIdentityCapability(MODULE_A1, "1.0.0");
builder.addManifestHeader("Service-Component", "OSGI-INF/org.jboss.test.gravia.runtime.embedded.sub.a1.ServiceA1.xml");
ManifestHeadersProvider headersProvider = new ManifestHeadersProvider(builder.getManifest());
return headersProvider.getHeaders();
}
示例7: getModuleHeadersA
import org.jboss.gravia.resource.ManifestBuilder; //导入方法依赖的package包/类
private Dictionary<String,String> getModuleHeadersA() {
ManifestBuilder builder = new ManifestBuilder();
builder.addIdentityCapability(MODULE_A, "1.0.0");
builder.addManifestHeader("Service-Component", "OSGI-INF/org.jboss.test.gravia.runtime.embedded.sub.a.EmbeddedServices.xml");
ManifestHeadersProvider headersProvider = new ManifestHeadersProvider(builder.getManifest());
return headersProvider.getHeaders();
}
示例8: testGenericCapabilities
import org.jboss.gravia.resource.ManifestBuilder; //导入方法依赖的package包/类
@Test
public void testGenericCapabilities() throws Exception {
ManifestBuilder manifestbuilder = new ManifestBuilder();
manifestbuilder.addIdentityCapability("some.name", "1.0.0");
manifestbuilder.addGenericCapabilities("test; effective:=\"resolve\"; test =\"aName\"; version : Version=\"1.0\"; long :Long=\"100\"; double: Double=\"1.001\"; string:String =\"aString\"; version.list:List < Version > = \"1.0, 1.1, 1.2\"; long.list : List <Long >=\"1, 2, 3, 4\"; double.list: List< Double>= \"1.001, 1.002, 1.003\"; string.list :List<String >= \"aString,bString,cString\"; string.list2:List=\"a\\\"quote,a\\,comma, aSpace ,\\start,\\,start,end\\\",end\\,\"; string.list3 :List<String>= \" aString , bString , cString \"");
manifestbuilder.addGenericCapabilities("test.multiple; attr=\"value1\"", "test.multiple; attr=\"value2\"", "test.no.attrs");
Manifest manifest = manifestbuilder.getManifest();
ManifestResourceBuilder builder = new ManifestResourceBuilder();
Resource resource = builder.load(manifest).getResource();
Assert.assertEquals(ResourceIdentity.fromString("some.name:1.0.0"), resource.getIdentity());
List<Capability> caps = resource.getCapabilities("test");
Assert.assertEquals(1, caps.size());
Assert.assertEquals("test", caps.get(0).getNamespace());
Map<String, String> dirs = caps.get(0).getDirectives();
Assert.assertEquals(1, dirs.size());
Assert.assertEquals("resolve", dirs.get("effective"));
Map<String, Object> atts = caps.get(0).getAttributes();
List<String> keys = new ArrayList<String>(atts.keySet());
Assert.assertEquals(11, keys.size());
Assert.assertEquals("test", keys.get(0));
Assert.assertEquals("aName", atts.get(keys.get(0)));
Assert.assertEquals("version", keys.get(1));
Assert.assertEquals(Version.parseVersion("1.0"), atts.get(keys.get(1)));
Assert.assertEquals("long", keys.get(2));
Assert.assertEquals(Long.valueOf("100"), atts.get(keys.get(2)));
Assert.assertEquals("double", keys.get(3));
Assert.assertEquals(Double.valueOf("1.001"), atts.get(keys.get(3)));
Assert.assertEquals("string", keys.get(4));
Assert.assertEquals("aString", atts.get(keys.get(4)));
Assert.assertEquals("version.list", keys.get(5));
List<Version> versions = Arrays.asList(Version.parseVersion("1.0"), Version.parseVersion("1.1"), Version.parseVersion("1.2"));
Assert.assertEquals(versions, atts.get(keys.get(5)));
Assert.assertEquals("long.list", keys.get(6));
List<Long> longs = Arrays.asList(Long.valueOf("1"), Long.valueOf("2"), Long.valueOf("3"), Long.valueOf("4"));
Assert.assertEquals(longs, atts.get(keys.get(6)));
Assert.assertEquals("double.list", keys.get(7));
List<Double> doubles = Arrays.asList(Double.valueOf("1.001"), Double.valueOf("1.002"), Double.valueOf("1.003"));
Assert.assertEquals(doubles, atts.get(keys.get(7)));
Assert.assertEquals("string.list", keys.get(8));
List<String> strings = Arrays.asList("aString", "bString", "cString");
Assert.assertEquals(strings, atts.get(keys.get(8)));
Assert.assertEquals("string.list2", keys.get(9));
strings = Arrays.asList("a\"quote", "a,comma", "aSpace", "\\start", ",start", "end\"", "end,");
Assert.assertEquals(strings, atts.get(keys.get(9)));
Assert.assertEquals("string.list3", keys.get(10));
strings = Arrays.asList("aString", "bString", "cString");
Assert.assertEquals(strings, atts.get(keys.get(10)));
caps = resource.getCapabilities("test.multiple");
Assert.assertEquals(2, caps.size());
Assert.assertEquals("test.multiple", caps.get(0).getNamespace());
atts = caps.get(0).getAttributes();
keys = new ArrayList<String>(atts.keySet());
Assert.assertEquals(1, keys.size());
Assert.assertEquals("attr", keys.get(0));
Assert.assertEquals("value1", atts.get(keys.get(0)));
Assert.assertEquals("test.multiple", caps.get(1).getNamespace());
atts = caps.get(1).getAttributes();
keys = new ArrayList<String>(atts.keySet());
Assert.assertEquals(1, keys.size());
Assert.assertEquals("attr", keys.get(0));
Assert.assertEquals("value2", atts.get(keys.get(0)));
caps = resource.getCapabilities("test.no.attrs");
Assert.assertEquals(1, caps.size());
Assert.assertEquals("test.no.attrs", caps.get(0).getNamespace());
atts = caps.get(0).getAttributes();
Assert.assertEquals(0, atts.size());
}