Announcement Announcement Module
Collapse
No announcement yet.
newbie: Examples of java apps Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • newbie: Examples of java apps

    I'm just starting to take a look at Roo and all the examples seem to be webapps. I'd like to create a JMS listener java app that has a persistance layer to store some of the JMS messages.

    So, once the entities / jms listeners have been created how using either Roo shell or STS can I build / execute a core java app.

    Thanks for any assistance ......... Geoff

  • #2
    I'm pretty sure Roo doesn't support the creation of Java applications at the moment. So you'll need to write your own "main" class that loads the ApplicationContext, etc., e.g,:

    Code:
    public final class Main {
    
        public static void main(final String[] args) throws Exception {
            final ApplicationContext applicationContext =
                new ClassPathXmlApplicationContext("META-INF/spring/applicationContext.xml");
            final MyService service = applicationContext.getBean(MyService.class);
            service.doSomething(...);
        }
    }

    Comment


    • #3
      Thanks for your reply Andrew. I came to the same conclusion and created a Main.class instantiating the applicationContext.

      Comment

      Working...
      X