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 18781 - Implement provides-requires semantics for module dependencies
Summary: Implement provides-requires semantics for module dependencies
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 17776 (view as bug list)
Depends on: 17501
Blocks: 17773 17815 23399
  Show dependency tree
 
Reported: 2001-12-18 15:08 UTC by Jesse Glick
Modified: 2008-12-23 13:45 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 Jesse Glick 2001-12-18 15:08:06 UTC
I.e. httpserver/manifest.mf:

OpenIDE-Module-Provides: org.openide.util.HttpServer$Impl

and e.g. web/core/manifest.mf:

OpenIDE-Module-Requires: org.openide.util.HttpServer$Impl

Then jsp.jar could only be enabled if httpserver.jar was too, yet there need be
no direct dependency.
Comment 1 Jesse Glick 2001-12-20 11:13:05 UTC
This could also be used for parts of core (e.g.
org.openide.compiler.CompilationEngine provided by
org.netbeans.core.compiler.CompilationEngineImpl) and XML (e.g.
javax.xml.parsers.SAXParserFactory provided by
org.apache.xerces.jaxp.SAXParserFactoryImpl).
Comment 2 Jan Chalupa 2002-01-11 14:04:28 UTC
Target milestone -> 3.4
Comment 3 Jan Chalupa 2002-01-11 14:08:24 UTC
Target milestone -> 3.4
Comment 4 Jan Chalupa 2002-01-11 14:09:18 UTC
Target milestone -> 3.4
Comment 5 Jan Chalupa 2002-01-11 14:11:54 UTC
Target milestone -> 3.4
Comment 6 Jesse Glick 2002-01-20 14:55:40 UTC
*** Issue 17776 has been marked as a duplicate of this issue. ***
Comment 7 Jesse Glick 2002-01-20 15:40:00 UTC
Probably important for various things.
Comment 8 Jesse Glick 2002-01-22 16:05:50 UTC
Making a branch module_deps_jan_2002 in core + openide + apisupport to
try to implement this, and maybe also bridge modules and
cross-major-release dependencies.
Comment 9 Jesse Glick 2002-01-23 19:06:20 UTC
Branching now nbbuild too. Bridge modules working.
Comment 10 Jesse Glick 2002-01-24 12:38:40 UTC
Technical details:

A module may specify an attribute OpenIDE-Module-Provides, with a list
of one or more tokens, each of which is in the format of a valid code
name base (identifiers separated by dots), separated by space and/or
comma. It may also or instead have OpenIDE-Module-Requires in the same
format.

public String[] ModuleInfo.getProvides() will produce the provides
list (maybe empty but never null). Dependency.TYPE_REQUIRES is added
to represent dependencies of the requires type; such dependencies may
have only a name, never a comparison.

If A provides token X and B requires it, then B has an implicit
dependency on A in the sense that A must be enabled for B to be
enabled, and A must be enabled before B, and B must be disabled before
A. B does *not* automatically get A as a parent in its classloader.
Provide-require dependencies count as dependencies for purposes of
cyclic dependencies, i.e. such cycles are illegal and will result in
none of the affected modules being installable.

If B requires X and no module provides it, B cannot be enabled.

If B requires X and both A1 and A2 provide it, B can be enabled
provided that at least one of A1 and A2 can be enabled. If A1 is
enabled, whether or not A2 is, and a request is made to enable B, it
is simply enabled. If neither A1 nor A2 is enabled, and a request is
made to enable B, both A1 and A2 are also enabled if possible. If only
one can, just that one is. If neither can, B cannot be enabled.

If B requires X and both A1 and A2 provide it, and all are enabled,
and a request is made to disable A1, it is simply done. If a request
is made to disable both A1 and A2, B is also disabled.

Little UI impact; same messaging used as for regular module
dependencies. In case a module cannot be enabled because there are no
enablable modules providing a token it requires, a different problem
message is used than for a regular module dependency that failed.
Comment 11 Jesse Glick 2002-01-25 15:51:49 UTC
Now apparently working correctly in the branch, pending unit tests.
Comment 12 Jesse Glick 2002-01-28 12:27:15 UTC
Work complete in branch, pending merge. Also branched autoupdate to match.
Comment 14 Jan Zajicek 2002-03-22 11:05:52 UTC
verified in 3.4 dev builds