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 225582

Summary: Provide API to get ModuleInfo by name
Product: platform Reporter: Tomas Pavek <tpavek>
Component: Module SystemAssignee: Jaroslav Tulach <jtulach>
Status: RESOLVED FIXED    
Severity: normal CC: apireviews, jrechtacek, mkleint
Priority: P2 Keywords: API_REVIEW_FAST
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: Proposed findCodeNameBase method
Changes I'd like to integrate tomorrow

Description Tomas Pavek 2013-01-31 09:13:30 UTC
Please provide API to obtain ModuleInfo for given code name base. It would be much more convenient and efficient than the currentl (only possible) way of looking up all ModuleInfos and iterating through them. Seems org.openide.modules.Modules could be extended in a compatible way for this purpose. Thanks
Comment 1 Tomas Pavek 2013-01-31 11:34:26 UTC
We need this in JDev startup when looking for extension.xml files in dependent modules. This is done via OSGi API, but BundleDescription.getRequiredBundles() does not return dependencies of NetBeans modules. So NetBeans module system API needs to be used here. Getting from Dependency to ModuleInfo by collecting all ModuleInfos and iterating through them is needlessly inefficient and also leads to unwanted disk touches during startup.
Comment 2 Jaroslav Tulach 2013-02-04 09:30:31 UTC
Created attachment 130978 [details]
Proposed findCodeNameBase method

Y01 Add apichanges.xml note
Comment 3 Jaroslav Tulach 2013-02-04 10:50:01 UTC
Btw. I am also considering to support add/removeModuleListener. I know there are various places in the NetBeans platform that want to be notified when a set of enabled modules changes (settings, ide.ergonomics, maven). I don't want to tight and delay Tomáš's API request due to the listener support, but if simple, I'd like to implement it.
Comment 4 Jiri Rechtacek 2013-02-11 15:31:27 UTC
(In reply to comment #1)
> We need this in JDev startup when looking for extension.xml files in dependent
> modules. This is done via OSGi API, but BundleDescription.getRequiredBundles()
> does not return dependencies of NetBeans modules. So NetBeans module system API
> needs to be used here. Getting from Dependency to ModuleInfo by collecting all
> ModuleInfos and iterating through them is needlessly inefficient and also leads
> to unwanted disk touches during startup.

Also Autoupdate Services could benefit from that API.
Comment 5 Jaroslav Tulach 2013-02-11 19:20:01 UTC
Created attachment 131261 [details]
Changes I'd like to integrate tomorrow
Comment 6 Jaroslav Tulach 2013-02-12 08:44:17 UTC
ergonomics#6a4a91385406
Comment 7 Jaroslav Tulach 2013-02-14 07:48:11 UTC
changeset:   a9d2d3b01c57
branch:      jdev_abrams
tag:         tip
parent:      7ea2f01b3e96
parent:      6a4a91385406
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Thu Feb 14 08:42:06 2013 +0100
summary:     Merge of #225582 for use in JDeveloper
Comment 8 Quality Engineering 2013-02-15 12:43:44 UTC
Integrated into 'main-golden', will be available in build *201302150954* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6a4a91385406
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #225582: Get ModuleInfo for code name base easily now