Alan Cabrera wrote:
> 
> 
>     [ 
> http://issues.apache.org/jira/browse/JAMES-495?page=comments#a
> ction_12412681 ] 
> 
> Alan Cabrera commented on JAMES-495:
> ------------------------------------
> 
> XBean is another alternative.

It is, though it might be more flexible to use as a source fronted by Commons 
Configuration. Using the lattter gives us a single API to aim at for static 
configuartion regardless of the source, which I see as a beneficial decoupling.

I'ld also like to see the configuration injected into each component conform to 
an  interface reflecting its specific requirements. This means something like:

1) Parse the configuarion sources
Configuration source1 > Commons Configuration
Configuration source2 > Commons Configuration
Configuration source3 > Commons Configuration

2) Create component a specific context
Commons Configuration > ComponentContext1 (Interface)
Commons Configuration > ComponentContext2 (Interface)
Commons Configuration > ComponentContextN (Interface)

3) Inject the context
ComponentContext1 > Component1
ComponentContext2 > Component2
ComponentContextN > ComponentN

This way the component doesn't care where the context comes from.

This also helps clear the path for updating the configuration dynamically on 
the fly. The context might be updated from another source, such as via JMX. 
Dynamic configuration raises a bunch of lifcycle problems, which having just 
seen Stefano's post I'll touch on there. 

-- Steve
 
> > Decide how to replace Avalon Configuration
> > ------------------------------------------
> >
> >          Key: JAMES-495
> >          URL: http://issues.apache.org/jira/browse/JAMES-495
> >      Project: James
> >         Type: Sub-task
> 
> >   Components: James Core
> >     Versions: 2.4.0
> >     Reporter: Stefano Bagnara
> >      Fix For: 2.4.0
> 
> >
> > We could switch to Commons-configuration or Obix 
> configuration framework, or anything else.
> > How should we configure our object?
> > Using configuration beans like we did in SMTPHandlerConfiguration?
> > Imho we should use something that allow us to:
> > 1) hot-reload configurations or part of configurations
> > 2) store configuration in JNDI
> > 3) simplify manageability of configuration from JMX
> > Any comment/proposal on that?
> > It would be easy to refactor our components to use "commons 
> Configuration" object instead of "avalon Configuration" (A 
> wrapper between the 2 configurations already exists): does it help?
> 
> -- 
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the 
> administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to