-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmoduleApplicationContext.xml
45 lines (40 loc) · 1.89 KB
/
moduleApplicationContext.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?xml version="1.0" encoding="UTF-8"?>
<!-- Beans to add to the current Application context definition -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="org.openmrs.module.ctechdev" />
<!-- Wraps CtechdevService methods in DB transactions and OpenMRS interceptors,
which set audit info like dateCreated, changedBy, etc.-->
<bean id="ctechdev.CtechdevService"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<bean class="org.openmrs.module.ctechdev.api.impl.CtechdevServiceImpl">
<property name="dao" ref="ctechdev.CtechdevDao" />
</bean>
</property>
<property name="preInterceptors">
<ref bean="serviceInterceptors" />
</property>
<property name="transactionAttributeSource">
<ref bean="transactionAttributeSource" />
</property>
</bean>
<!-- Adds CtechdevService to OpenMRS context so it can be accessed
calling Context.getService(CtechdevService.class) -->
<bean parent="serviceContext">
<property name="moduleService">
<list>
<value>org.openmrs.module.ctechdev.api.CtechdevService</value>
<ref bean="ctechdev.CtechdevService" />
</list>
</property>
</bean>
</beans>