On Sat, Oct 17, 2009 at 12:16 PM, Norman Maurer <[email protected]> wrote: > Hi all, > I'm currently looking into using guice for dependency injection to > replace Avalon. From my current knowing it should be possible to > create a guice module per James module (for example > smtpserver-function) which will be used with the guice injector to > wirethings. The guice injector will get the needed modules from a > properties file to > make it as flexible as possible. > The needed stuff will get injected via jsr250 annotations.this will > should be no problem , the only thing which gives me headaches is the > replacement of the current Avalon configurable livecycle method. The > configuration should get done after all other dependencies are > injected, so just do it in the injection method of the configuration > object will not work. so I'm leaning toward just inject the > configuration and do the real configuration after all is injected via > a method annotated with @PostConstruct.
IIRC the way i approached this was to refactor slightly so that the processing of the configuration happens in @PostConstruct but the setting happens earlier (during injection). this allows more freedom to choose (in each case) whether injecting a coarsely grained complete configuration object or several smaller, more finely grained objects makes more sense. - robert --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
