Results 1 to 4 of 4

Thread: Loading a context in command-line applications

  1. #1
    Join Date
    Dec 2005
    Posts
    930

    Default Loading a context in command-line applications

    I'm looking for a convenient, clean and resuable means of loading an application context for standard java command-line applications. I've been writing a number of batch type applications lately and I load the context with the ClasspathXmlApplicationContext in the main method.

    Before I write something myself, I wanted to know if Spring provides, or someone has written something elegant that is analogous to the AbstractDependencyInjectionSpringContextTests for junit tests, where the user just implements the getConfigLocations() method.
    Thanks
    Alan

  2. #2
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    I'm pretty sure there was a discussion about something similar a few months ago. I'd have a search for it.
    Last edited by karldmoore; Aug 27th, 2007 at 02:58 PM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

  3. #3
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Which problem do you try to solve?

    You may load context with just 1 or 2 lines of code straightforward and absolutely understandable code.

    Which benefits should prospective solution to bring? Just make the things less obvious or something else?

    Regards,

    Oleksandr

    Quote Originally Posted by aks View Post
    I'm looking for a convenient, clean and resuable means of loading an application context for standard java command-line applications. I've been writing a number of batch type applications lately and I load the context with the ClasspathXmlApplicationContext in the main method.

    Before I write something myself, I wanted to know if Spring provides, or someone has written something elegant that is analogous to the AbstractDependencyInjectionSpringContextTests for junit tests, where the user just implements the getConfigLocations() method.
    Thanks
    Alan

  4. #4
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Quote Originally Posted by al0 View Post
    You may load context with just 1 or 2 lines of code straightforward and absolutely understandable code.

    Which benefits should prospective solution to bring? Just make the things less obvious or something else?
    I'm pretty sure this was the general response to the post I mentioned earlier. If you are just loading the applicationContext, there's not really much more to do.
    Last edited by karldmoore; Aug 27th, 2007 at 02:58 PM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

Posting Permissions

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