Help required. Thanks in advance.
How to make simple groovy Class behave like a Grails service in groovy module? Or How to create Grails service class in Groovy Module??
Basically, a Service
class features the following:
singleton
in the app (by default, other scopes are really rare)so, you can define a Groovy/Java class anywhere, add @Transactional
into it, and define it in Spring app-context
under conf/spring/resources.groovy
as a singleton:
beans = {
yourServicePretender YourServicePretenderClassName
}
Volia, you "service" is ready!