Announcement Announcement Module
Collapse
No announcement yet.
Loading a context in command-line applications Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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, 02:58 PM.

    Comment


    • #3
      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

      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

      Comment


      • #4
        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, 02:58 PM.

        Comment

        Working...
        X