This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 197908 - Alternative Bundle-SymbolicName for NetBeans modules
Summary: Alternative Bundle-SymbolicName for NetBeans modules
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Netigso (show other bugs)
Version: 7.0.1
Hardware: All All
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 197842
  Show dependency tree
 
Reported: 2011-04-20 14:16 UTC by Jaroslav Tulach
Modified: 2011-08-19 14:43 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2011-04-20 14:16:24 UTC
The 7.0 Netigso system always deduces Bundle-SymbolicName from the OpenIDE-Module tag. This works for NetBeans own libraries, but not for 3rd party ones.

For example jgit has dependency on com.jcraft.jsch bundle, but in NetBeans this bundle is named org.netbeans.libs.jsch. We cannot (easily) rename that, but still we'd like the jgit bundle to link properly.

Netigso system can handle that. If there is 

Netigso-SymbolicName: ...
Netigso-Version: ...

in manifest, it can use these values for generating the fake OSGi bundle. Then the OSGi systems will see the NetBeans module under different name and link bundles  like jgit in more flexible way.

Btw. Netigso could potentially generate more fake bundles than one, but that does not seem to be needed now.
Comment 1 Jesse Glick 2011-04-20 14:19:54 UTC
Would seem to be simpler to just specify the actual OSGi tags in the JAR manifest, e.g.:

OpenIDE-Module: org.netbeans.libs.jsch/1
OpenIDE-Module-Specification-Version: 1.17
Bundle-SymbolicName: com.jcraft.jsch
Bundle-Version: 0.1.43

The NB module system will use OpenIDE-Module* preferentially, whereas the OSGi container will only pay attention to Bundle-*.
Comment 2 Jaroslav Tulach 2011-04-21 11:48:21 UTC
(In reply to comment #1)
> Would seem to be simpler to just specify the actual OSGi tags in the JAR
> manifest, e.g.:

That would be misleading.

> The NB module system will use OpenIDE-Module* preferentially, whereas the OSGi
> container will only pay attention to Bundle-*.

As the JARs are not proper OSGi bundles and the runtime would treat them like that. Such JARs can only be executed in Netigso and thus it makes more sense to use Netigso specific tag.
Comment 3 Jesse Glick 2011-04-21 13:35:12 UTC
(In reply to comment #2)
> the JARs are not proper OSGi bundles

True, because (external) Class-Path is not supported by OSGi.

Obviously Netigso.fakeBundle would need to be modified. The tricky part is that the netigso:// URL is used in several places with the assumption that the host part is both a NB CNB and an OSGi BSN: Netigso.fakeOneModule, Netigso.toActivate, and NetigsoActivator.get. I think the best fix is to treat the host part as a BSN; then toActivate requires no change, fakeOneModule just needs to check for the variant attr, and get needs to do the same.

I can try to do the changes in a branch. Might take a little work to understand how to write a unit test for it.
Comment 4 Jaroslav Tulach 2011-04-21 16:22:55 UTC
OK, if you wish. Unit tests are as easy as the ones for regular ModuleManager.
Comment 5 Jesse Glick 2011-04-21 16:53:40 UTC
Committed to a branch: core-main #34830f9b9da8
Comment 6 Jesse Glick 2011-05-05 12:35:30 UTC
Backed it out; not usable.
Comment 7 Quality Engineering 2011-08-19 14:43:23 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/34830f9b9da8
User: Jesse Glick <jglick@netbeans.org>
Log: #197908: permit a module to declare an alternate BSN and/or version when considered as a bundle.