File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What can I access from /grails-app/src/java (and /grails-app/src/groovy)

 
andrew ennamorato
Ranch Hand
Posts: 100
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Stole" some code from Burt Beckwith that enables some simple JMS integration into a Grails application.
In this case, the controller puts a message on a JMS queue - a listener then reads that message and writes it to the console.

The listener is just a POGO and is in /grails-app/src/groovy. I'm still learning Groovy/Grails and am curious what other objects/packages you have access to from this directory? Obviously it is being compiled in with the application (as I can see the console output), but can I access domain classes/objects here? Grails services? I'd love to make a similar listener that just updates domain-classes/objects, but sure that would work.

Also trying to avoid (for now) the Grails JMS-plugin, but if I have to use it I can. The goal is just a simple Grails app that listens to a JMS topic, and updates a DB (and therefore web page) with stats.
 
andrew ennamorato
Ranch Hand
Posts: 100
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you *can* get to domain classes from src/groovy. Still not exactly sure how/why that works, though.

A better question is, what I really need is essentially a message driven bean, but in Grails. Is there an equivalent? Do I make it a service? Better off as a POGO here in src/groovy? Or is that just a style question that's up to me?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic