Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Dynamic nested properties

  1. #11
    Join Date
    Jan 2005
    Posts
    14

    Default

    Yep, basically it means that I have to 'implement' the lifecycle management myself.
    First instantiate (partially programmatic) all beans since I definitely do not want a depends-on a dynamic list and afterwards initialize....

    Thanks for the help,
    Barry

  2. #12
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Quote Originally Posted by irbouho
    If all the devices implement an IDevice interface, you can make DeviceManager look for devices using factory.getBeansOfType(IDevice.class). DeviceManager needs, of course, to implement BeanFactoryAware. This Implies that all devices will be manager by the same manager.
    HTH
    Isn't this simpler to do?
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #13
    Join Date
    Jan 2005
    Posts
    14

    Default

    Quote Originally Posted by irbouho
    Quote Originally Posted by irbouho
    If all the devices implement an IDevice interface, you can make DeviceManager look for devices using factory.getBeansOfType(IDevice.class). DeviceManager needs, of course, to implement BeanFactoryAware. This Implies that all devices will be manager by the same manager.
    HTH
    Isn't this simpler to do?
    Well.... yes and no. Simpler because it does what I want to do, but not simpler since I would make my code dependant of Spring.

    We are currently changing from Avalon to Spring, but I want to be able to switch just as quickly to Pico (for instance) if Spring doesn't do what I want to do.....

    On the other hand... it is worth giving a try :wink:

  4. #14
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    One thing I just thought of:

    If you can live with having your device beans in another configuration file (or several other configuration file) than the device-manager bean you could do the following:

    Initialize your device-manager with a BeanPostProcessor which looks up the other configuration files and loads the contained device-beans. For this you could use the approach I mentioned some postings above. This way you do not have to take care about the order in which beans will be initialized within one context file. The lookup path/ file pattern might be configured with properties of your BeanPostProcessor.

    Regards,
    Andreas

Similar Threads

  1. FlowExecutionStorage in a DB
    By cacho in forum Web Flow
    Replies: 7
    Last Post: Oct 19th, 2009, 03:36 PM
  2. Replies: 9
    Last Post: Sep 10th, 2006, 03:52 PM
  3. Context initialization failed
    By kanonmicke in forum Container
    Replies: 7
    Last Post: Sep 29th, 2005, 12:35 AM
  4. Dynamic form and nested properties
    By HeideMeister in forum Web
    Replies: 1
    Last Post: Mar 3rd, 2005, 08:04 AM
  5. Replies: 3
    Last Post: Nov 8th, 2004, 07:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •