• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic