Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Many of Geode's sub-projects depend on one another. In the world of the ClassLoader Isolation work, those dependencies are explicitly defined when modules are loaded and linked to one another. For the most part, this is fine as JBoss is designed to handle dependencies between modules. However, some modules have bidirectional dependencies (A dependents on B and B depends on A). We want to be able to enable and disable features at runtime. This means loading and unloading modules. We could unload, reload, and relink every module whenever a new module is added or removed, but that is potentially costly. We need a way to update the linkages between modules without having to refresh every module.An example of this is logging; geode-log4j explicitly depends on geode-logging, and geode-logging, while it doesn't state it, requires geode-log4j to be on the classpath. There is also a similar relationship between geode-core and geode-http-service. Normally, this is fine because everything is on the classpath, but when modularized, geode-logging won't be able to access geode-log4j unless it explicitly depends on it, but if that were the case, there would be a cyclical dependency, which is not allowed.

Anti-Goals

This proposal is only intended to solve the problems of allowing bidirectional dependencies between modules and the loading/unloading of modules without having to reload all modules and is unconcerned with...

  • Breaking existing bidirectional dependenciesChanging any dependencies between modules.

Solution

The proposed solution is to introduce a linking module, which will contain no code and instead consist only of dependencies. This linking module will depend on every other module and every other module will depend on it. This creates a path between all modules so bidirectional relationships can be resolved. This solution also solves the problem of having to refresh all modules when adding or removing a module. Since all modules are linked to the linking module, it can refresh itself with the new set of loaded modules and the other modules don't have to change–they just keep their link tot he linking modulewill have a similar effect to having everything on the classpath, but differs in that modules will look inside themselves first before getting classes from other modules. This allows modules to access whatever they need, without allowing version conflicts, like we would get with everything on the classpath.

Changes and Additions to Public Interfaces

...

Break all bidirectional dependencies between sub-projects and incur the cost of updating all effected modules when loading/unloading.

FAQ

Answers to questions you’ve commonly been asked after requesting comments for this proposal.

...