-
Notifications
You must be signed in to change notification settings - Fork 0
/
springCoreDISIAppContext.xml
62 lines (45 loc) · 2.28 KB
/
springCoreDISIAppContext.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
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="UTF-8"?>
<!-- 3. Dependency Injection(DI): using Setter Injection (SI) -->
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Add a logger config to see logging messages. - For more detailed logs,
set values to "FINEST" - For info on logging levels, see: http://www.vogella.com/tutorials/Logging/article.html -->
<bean id="myLoggerConfig"
class="learning.spring.logging.MyXMLLoggerConfig"
init-method="initLogger">
<property name="rootLoggerLevel" value="FINE"/>
<property name="printedLoggerLevel" value="FINE"/>
</bean>
<!-- Define your beans here -->
<!-- Dependency Injection Part(DI) -->
<!-- Define the dependency -->
<bean id="fortuneService"
class="learning.spring.core.xml.di.common.services.HappyFortuneService">
</bean>
<!-- If you want TrackCoach in your application. -->
<!--<bean id="myCoachDISI"
class="learning.spring.core.xml.di.si.coach.TrackCoach">
<!– set up setter injections –>
<property name="fortuneService" ref="fortuneService"/>
<property name="emailAddress" value="abc@abc.com" />
<property name="teamName" value="Best Tracks Rocks" />
</bean>-->
<!-- If you want CricketCoach in your application. -->
<!--<bean id="myCoachDISI"
class="learning.spring.core.xml.di.si.coach.CricketCoach">
<!– set up setter injections –>
<property name="fortuneService" ref="fortuneService"/>
<property name="emailAddress" value="cricket@abc.com"/>
<property name="teamName" value="Royal Challengers Bengaluru."/>
</bean>-->
<!-- If you want BaseBallCoach in your application. -->
<bean id="myCoachDISI"
class="learning.spring.core.xml.di.si.coach.BaseBallCoach">
<!-- set up setter injections -->
<property name="fortuneService" ref="fortuneService"/>
<property name="emailAddress" value="baseball@abc.com"/>
<property name="teamName" value="Best BaseBall(BBB) Team"/>
</bean>
</beans>