tags:

views:

585

answers:

2

Hi.

I'm just wondering if it's possible to create Spring managed beans backed by Clojure code (Clojure namespace I guess, would implement regular Java interface)? If so, the example would be appreciated.

Thanks, Dmitriy.

A: 

See this this as an example of clojure, spring, junit and swt integration.

Dev er dev
No, this is not what I mean. I'm asking how to compile, configure a Clojure class as a regular Spring-managed bean which then becomes eligible for injection into other Spring-managed beans, etc. The example shows the other way around i.e. how to use Spring ApplicationContext from Clojure code.
Dmitriy Kopylenko
+3  A: 

Hello there,

I haven't tried that yet, but section 3.3 of Programming Clojure explains how to create class files with the :gen-class form. Use it with :implements and :extends, build a JAR from your classes and import them into your Spring project. That should - theoretically - do the trick.

I'd be very interested in any example code, too, by the way.

springify
Yeah, that seems to be the way. I'd try it when I have a chance.
Dmitriy Kopylenko