PDA

View Full Version : inner class as a bean ?



boz
Sep 28th, 2004, 08:33 AM
Can an inner class be declared as a bean?...

<bean id="myThingSyncLock"
class="com.moo.MyThing$SyncLock"/>

What I'm trying to do is synchronize cache access from a non-singleton bean. I want to use IoC to pass in an application-context scoped singleton that can be used as a lock. Using an inner class would make the code cleaner, I think.

Thanks,
boz

boz
Sep 28th, 2004, 10:06 AM
Fixed.

The inner class was not static. Making it static works fine.