[
https://jira.jboss.org/browse/SHRINKWRAP-139?page=com.atlassian.jira.plug...
]
Thomas Diesler edited comment on SHRINKWRAP-139 at 8/12/10 3:50 AM:
--------------------------------------------------------------------
Currently we use a rather verbose syntax like
// Bundle-SymbolicName: simple-fragA
// Export-Package: org.jboss.test.osgi.fragments.fragA
// Fragment-Host: simple-hostA
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class,
"simple-hostA");
archive.addClasses(FragBeanA.class);
archive.addResource(getResourceFile("fragments/resource.txt"));
archive.setManifest(new Asset()
{
public InputStream openStream()
{
OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
builder.addBundleManifestVersion(2);
builder.addBundleSymbolicName(archive.getName());
builder.addExportPackages(FragBeanA.class);
builder.addFragmentHost("simple-hostA");
return builder.openStream();
}
});
Bundle fragA = installBundle(archive);
assertBundleState(Bundle.INSTALLED, fragA.getState());
This should be supported natively by Shrinkwrap
// Bundle-SymbolicName: simple-fragA
// Export-Package: org.jboss.test.osgi.fragments.fragA
// Fragment-Host: simple-hostA
final BundleArchive archive = ShrinkWrap.create(BundleArchive.class,
"simple-hostA");
archive.addClasses(FragBeanA.class);
archive.addResource(getResourceFile("fragments/resource.txt"));
archive.addBundleManifestVersion(2);
archive.addBundleSymbolicName(archive.getName());
archive.addExportPackages(FragBeanA.class);
archive.addFragmentHost("simple-hostA");
Bundle fragA = installBundle(archive);
assertBundleState(Bundle.INSTALLED, fragA.getState());
or similar.
See
http://github.com/jbosgi/jbosgi-spi/blob/master/src/main/java/org/jboss/o...
was (Author: thomas.diesler(a)jboss.com):
Currently we use a rather verbose syntax like
// Bundle-SymbolicName: simple-fragA
// Export-Package: org.jboss.test.osgi.fragments.fragA
// Fragment-Host: simple-hostA
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class,
"simple-hostA");
archive.addClasses(FragBeanA.class);
archive.addResource(getResourceFile("fragments/resource.txt"));
archive.setManifest(new Asset()
{
public InputStream openStream()
{
OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
builder.addBundleManifestVersion(2);
builder.addBundleSymbolicName(archive.getName());
builder.addExportPackages(FragBeanA.class);
builder.addFragmentHost("simple-hostA");
return builder.openStream();
}
});
Bundle fragA = installBundle(archive);
assertBundleState(Bundle.INSTALLED, fragA.getState());
This should be supported natively by Shrinkwrap
// Bundle-SymbolicName: simple-fragA
// Export-Package: org.jboss.test.osgi.fragments.fragA
// Fragment-Host: simple-hostA
final BundleArchive archive = ShrinkWrap.create(BundleArchive.class,
"simple-hostA");
archive.addClasses(FragBeanA.class);
archive.addResource(getResourceFile("fragments/resource.txt"));
archive.addBundleManifestVersion(2);
archive.addBundleSymbolicName(archive.getName());
archive.addExportPackages(FragBeanA.class);
archive.addFragmentHost("simple-hostA");
Bundle fragA = installBundle(archive);
assertBundleState(Bundle.INSTALLED, fragA.getState());
or similar.
See
http://github.com/jbosgi/jbosgi-spi/blob/78a8c3220ad197bf91df47bb756ed1ff...
Ability to generate OSGi bundle headers
---------------------------------------
Key: SHRINKWRAP-139
URL:
https://jira.jboss.org/browse/SHRINKWRAP-139
Project: ShrinkWrap
Issue Type: Feature Request
Reporter: Pete Muir
As we control the classpath generating an OSGi bundle header should be straightforward.
Introducing an API to customize it is perhaps harder, but should be possible.
May want to look at delegating to BND (
http://www.aqute.biz/Code/Bnd).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira