1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.config; |
17 | |
|
18 | |
import org.kuali.rice.core.config.ConfigurationException; |
19 | |
import org.kuali.rice.core.resourceloader.GlobalResourceLoader; |
20 | |
import org.springframework.beans.factory.FactoryBean; |
21 | |
import org.springframework.beans.factory.InitializingBean; |
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | 0 | public class GlobalResourceLoaderServiceFactoryBean implements FactoryBean, InitializingBean { |
30 | |
|
31 | |
private String serviceName; |
32 | |
private boolean singleton; |
33 | |
|
34 | |
public Object getObject() throws Exception { |
35 | 0 | return GlobalResourceLoader.getService(this.getServiceName()); |
36 | |
} |
37 | |
|
38 | |
public Class getObjectType() { |
39 | 0 | return Object.class; |
40 | |
} |
41 | |
|
42 | |
public boolean isSingleton() { |
43 | 0 | return singleton; |
44 | |
} |
45 | |
|
46 | |
public String getServiceName() { |
47 | 0 | return serviceName; |
48 | |
} |
49 | |
|
50 | |
public void setServiceName(String serviceName) { |
51 | 0 | this.serviceName = serviceName; |
52 | 0 | } |
53 | |
|
54 | |
public void setSingleton(boolean singleton) { |
55 | 0 | this.singleton = singleton; |
56 | 0 | } |
57 | |
|
58 | |
public void afterPropertiesSet() throws Exception { |
59 | 0 | if (this.getServiceName() == null) { |
60 | 0 | throw new ConfigurationException("No serviceName given."); |
61 | |
} |
62 | 0 | } |
63 | |
|
64 | |
} |