1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.krms.impl.repository; |
17 | |
|
18 | |
import org.apache.log4j.Logger; |
19 | |
import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader; |
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | 0 | public final class KrmsRepositoryServiceLocator { |
28 | |
|
29 | 1 | private static final Logger LOG = Logger.getLogger(KrmsRepositoryServiceLocator.class); |
30 | |
|
31 | |
public static final String KRMS_ATTRIBUTE_DEFINITION_SERVICE = "krmsAttributeDefinitionService"; |
32 | |
|
33 | |
private static KrmsAttributeDefinitionService krmsAttributeDefinitionService; |
34 | |
|
35 | |
public static <T extends Object> T getService(String serviceName) { |
36 | 0 | return KrmsRepositoryServiceLocator.<T>getBean(serviceName); |
37 | |
} |
38 | |
|
39 | |
public static <T extends Object> T getBean(String serviceName) { |
40 | 0 | if ( LOG.isDebugEnabled() ) { |
41 | 0 | LOG.debug("Fetching service " + serviceName); |
42 | |
} |
43 | 0 | return GlobalResourceLoader.<T>getService(serviceName); |
44 | |
} |
45 | |
|
46 | |
public static KrmsAttributeDefinitionService getKrmsAttributeDefinitionService() { |
47 | 6 | if ( krmsAttributeDefinitionService == null ) { |
48 | 0 | krmsAttributeDefinitionService = getService(KRMS_ATTRIBUTE_DEFINITION_SERVICE); |
49 | |
} |
50 | 6 | return krmsAttributeDefinitionService; |
51 | |
} |
52 | |
|
53 | |
public static void setKrmsAttributeDefinitionService(final KrmsAttributeDefinitionService service) { |
54 | 4 | krmsAttributeDefinitionService = service; |
55 | 4 | } |
56 | |
|
57 | |
} |