Results 1 to 2 of 2

Thread: Dynamic Loading of Beans (dynamic conext file creator)

  1. #1
    Join Date
    May 2006
    Location
    London
    Posts
    2

    Default Dynamic Loading of Beans (dynamic conext file creator)

    I'm currently writing an application which only knows at startup what (visual) components it will show by reading a config file it gets from another program.

    So it's not possible to have a prewritten context file to wire everything together.

    But what is possible, I think, is to create the context file on the fly and than pass it on to the spring framework.

    My question is: is there a way in spring to do this 'dynamic context file creation' or do I have to write my own 'engine'?

    Regards,

    Olivier

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Spring configuration can be entirely created programatically - with the XML file this process happens behind the scenes. For your case, I would advice you to write a custom BeanDefinitionReader that do the appropriate calls to the Spring API.
    Take a look at the javadocs and the sources - Spring provides plenty of base classes so you can implement only what you are interested in.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

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