01: /*
02: * Created on 25-Jan-2006
03: */
04: package uk.org.ponder.rsac;
05:
06: import org.springframework.beans.factory.InitializingBean;
07:
08: import uk.org.ponder.beanutil.BeanLocator;
09:
10: /** Since all RSAC beans are by default lazy, we requre this class to
11: * force-load any beans that have their dependencies inverted for some
12: * reason.
13: * <p>Think of a better solution at some point.
14: * @author Antranig Basman (amb26@ponder.org.uk)
15: *
16: */
17:
18: public class RSACBeanLoader implements InitializingBean {
19:
20: private BeanLocator beanlocator;
21: private String[] beannames;
22:
23: public void setBeanLocator(BeanLocator beanlocator) {
24: this .beanlocator = beanlocator;
25: }
26:
27: public void setBeanNames(String[] beannames) {
28: this .beannames = beannames;
29: }
30:
31: public void afterPropertiesSet() {
32: for (int i = 0; i < beannames.length; ++i) {
33: beanlocator.locateBean(beannames[i]);
34: }
35: }
36: }
|