Questions tagged [spring-groovy-config]

6 questions
3
votes
1 answer

"Manually" creating beans with Grails BeanBuilder or Spring GenericGroovyApplicationContext

I have a class with complicated creation logic (e.g. uses builder). Back in 2000, because XML is rigid and not a programming language, I couldn't code the creation logic in it, so I encapsulated it in a FactoryBean. Then the blessed JavaConfig came…
JBaruch
  • 22,610
  • 5
  • 62
  • 90
2
votes
2 answers

Grails 2.4.2 bean spring bean injection

Sample app located here : https://github.com/rushidesai1/Grails2_4_2_BeanIssue Question: In resources.groovy if we declare a bean like this beans = { testObject(TestObject){bean -> bean.scope = "prototype" map = new HashMap() //…
2
votes
1 answer

How to invoke bean method from spring groovy-based configuration file?

How to invoke method from spring configuration groovy-based file? I know about MethodInvokingFactoryBean, but i want more simple way. My bean: public class Foo{ public void func(String prm1, int prm2){ System.out.println("Func called with…
chabapok
  • 921
  • 1
  • 8
  • 14
1
vote
1 answer

Making bean definitions in Groovy Bean Definition DSL order-independent

The only downside I currently see in the new Groovy Bean Definition DSL is that the beans in the closure must be declared in the dependency order. For example, while this works: beans { repository(RepositoryImpl) service(ServiceImpl) { …
JBaruch
  • 22,610
  • 5
  • 62
  • 90
0
votes
1 answer

Groovy Spring configuration with lookup method

I can't find more effective way to implement lookup method with groovy configuration (only groovy!) than that: // abstract Java class with lookup method public abstract class GMyFrame extends JFrame { private Color startColor; public GMyFrame() { …
dSH
  • 143
  • 6
0
votes
1 answer

Importing Spring Framework in groovyConsole throws error

I have a very simple Groovy script: import org.springframework.*; @groovy.transform.ToString() @Controller(name="myHomeController") class HomeController { String home() { } } As I use the @Controller annotation I used the menu option:…
Victor M Perez
  • 2,185
  • 3
  • 19
  • 22