1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.krms.api; |
17 | |
|
18 | |
import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader; |
19 | |
import org.kuali.rice.krms.api.engine.Engine; |
20 | |
import org.kuali.rice.krms.api.repository.RuleRepositoryService; |
21 | |
import org.kuali.rice.krms.api.repository.type.KrmsTypeRepositoryService; |
22 | |
|
23 | |
import javax.xml.namespace.QName; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | 0 | public class KrmsApiServiceLocator { |
31 | |
|
32 | |
public static final String ENGINE = "rice.krms.engine"; |
33 | 0 | public static final QName RULE_REPOSITORY_SERVICE = new QName(KrmsConstants.Namespaces.KRMS_NAMESPACE_2_0, "ruleRepositoryService"); |
34 | 0 | public static final QName KRMS_TYPE_REPOSITORY_SERVICE = new QName(KrmsConstants.Namespaces.KRMS_NAMESPACE_2_0, "krmsTypeRepositoryService"); |
35 | |
|
36 | |
static <T> T getService(String serviceName) { |
37 | 0 | return GlobalResourceLoader.<T>getService(serviceName); |
38 | |
} |
39 | |
|
40 | |
static <T> T getService(QName serviceName) { |
41 | 0 | return GlobalResourceLoader.<T>getService(serviceName); |
42 | |
} |
43 | |
|
44 | |
public static Engine getEngine() { |
45 | 0 | return getService(ENGINE); |
46 | |
} |
47 | |
|
48 | |
public static RuleRepositoryService getRuleRepositoryService() { |
49 | 0 | return getService(RULE_REPOSITORY_SERVICE); |
50 | |
} |
51 | |
|
52 | |
public static KrmsTypeRepositoryService getKrmsTypeRepositoryService() { |
53 | 0 | return getService(KRMS_TYPE_REPOSITORY_SERVICE); |
54 | |
} |
55 | |
|
56 | |
} |