We need to decide if we want this only in 2.1M1 or also in 2.0 final
or 2.0.x.
Reminder: This is needed to allow wiki macros to be able to be written
in multiwiki environments.
Note: The code I have so far for it doesn't seem too dangerous.
WDYT?
Thanks
-Vincent
On Sep 8, 2009, at 9:28 AM, Vincent Massol wrote:
Hi,
We have the need to isolate groups of components. For ex a wiki
macro created in a subwiki should only be visible in that subwiki by
default.
Here's an implementation proposal that I'm planning to implement:
* There's a Root Component Manager (the current CM)
* There are 3 components which implement the ComponentManager role
and with 3 hints: "wiki", "user" and "all". There's a
CompositeComponentManager class that allows chaining CM and the
"all" CM chains the "default" (root CM), "wiki" CM and
"user" CM.
This works the same as with the configuration module.
* Other components can have CMs injected as they want (if not
specified then it's the default, etc). For ex:
@Requirement("all")
private ComponentManager cm
* Creation process. As for now the user creates the root CM and then
the annotation loader will create the descriptors for the other CMs
and register them against the root CM. They'll get instantiated once
(singleton) the first time they're looked up.
* In order to register a component for, say, a given "enterprise"
wiki, we need to add a new property to the ComponentDescriptor: get/
setAdditionalData(Object data). For example:
wikiCM.registerComponent(CD mycd) where
cd.setAdditionalData("enterprise").
* Last, Guice uses Modules to isolate component definitions so it
should be possible and relatively easy to port the implementation to
Guice (even though Guice uses static Modules we can make them
dynamic).
WDYT?
Thanks
-Vincent