File tree Expand file tree Collapse file tree 13 files changed +33
-27
lines changed
1.1-common-frameworks/spring Expand file tree Collapse file tree 13 files changed +33
-27
lines changed Original file line number Diff line number Diff line change 5
5
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd" >
6
6
7
7
8
- <bean id =" Notifier" class =" com.github.vedenin.rus.spring_xml.XmlConstructorAutowiredTest $Notifier" >
8
+ <bean id =" Notifier" class =" xml.XmlConstructorAutowiredHelloWorld $Notifier" >
9
9
<constructor-arg ref =" NotificationService" />
10
10
</bean >
11
11
12
- <bean id =" NotificationService" class =" com.github.vedenin.rus.spring_xml.XmlConstructorAutowiredTest $EMailService" ></bean >
12
+ <bean id =" NotificationService" class =" xml.XmlConstructorAutowiredHelloWorld $EMailService" ></bean >
13
13
14
14
</beans >
Original file line number Diff line number Diff line change 5
5
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd" >
6
6
7
7
8
- <bean id =" Notifier" class =" com.github.vedenin.rus.spring_xml. jsr300.XmlConstructorInjectTest $Notifier" >
8
+ <bean id =" Notifier" class =" xml. jsr300.XmlConstructorInjectHelloWorld $Notifier" >
9
9
<constructor-arg ref =" NotificationService" />
10
10
</bean >
11
11
12
- <bean id =" NotificationService" class =" com.github.vedenin.rus.spring_xml. jsr300.XmlConstructorInjectTest $EMailService" ></bean >
12
+ <bean id =" NotificationService" class =" xml. jsr300.XmlConstructorInjectHelloWorld $EMailService" ></bean >
13
13
14
14
</beans >
Original file line number Diff line number Diff line change 5
5
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd" >
6
6
7
7
8
- <bean id =" Notifier" class =" com.github.vedenin.rus.spring_xml.XmlFieldAutowiredTest $Notifier" >
8
+ <bean id =" Notifier" class =" xml.XmlFieldAutowiredHelloWorld $Notifier" >
9
9
<property name =" service" ref =" NotificationService" />
10
10
</bean >
11
11
12
- <bean id =" NotificationService" class =" com.github.vedenin.rus.spring_xml.XmlFieldAutowiredTest $EMailService" />
12
+ <bean id =" NotificationService" class =" xml.XmlFieldAutowiredHelloWorld $EMailService" />
13
13
14
14
</beans >
Original file line number Diff line number Diff line change 5
5
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd" >
6
6
7
7
8
- <bean id =" Notifier" class =" com.github.vedenin.rus.spring_xml.XmlFieldAutowiredTest $Notifier" >
8
+ <bean id =" Notifier" class =" xml.XmlFieldAutowiredHelloWorld $Notifier" >
9
9
<property name =" service" ref =" NotificationService" />
10
10
</bean >
11
11
12
- <bean id =" NotificationService" class =" com.github.vedenin.rus.spring_xml.XmlFieldAutowiredTest $EMailService" />
12
+ <bean id =" NotificationService" class =" xml.XmlFieldAutowiredHelloWorld $EMailService" />
13
13
14
14
</beans >
Original file line number Diff line number Diff line change 4
4
import org .springframework .context .annotation .Configuration ;
5
5
6
6
/**
7
- * Constructor DI injection
7
+ * Constructor DI injection Hello World using Java annotation
8
8
*
9
9
* Created by vvedenin on 11/14/2015.
10
10
*/
11
- public class SpringConstructorAutowiredTest {
11
+ public class SpringConstructorAutowiredHelloWorld {
12
12
public static class Notifier {
13
13
private final NotificationService service ;
14
14
@@ -48,6 +48,6 @@ public NotificationService getNotificationService(){
48
48
public static void main (String [] args ) throws Exception {
49
49
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext (DIConfiguration .class );
50
50
Notifier notifier = context .getBean (Notifier .class );
51
- notifier .send ("test email " ); // Print "I send email: test email "
51
+ notifier .send ("Hello world! " ); // Print "I send email: Hello world! "
52
52
}
53
53
}
Original file line number Diff line number Diff line change 4
4
import org .springframework .context .annotation .Configuration ;
5
5
6
6
/**
7
- * Field DI injection
7
+ * Field DI injection Hello World using Java annotation
8
8
*
9
9
* Created by vvedenin on 11/14/2015.
10
10
*/
11
- public class SpringFieldAutowiredTest {
11
+ public class SpringFieldAutowiredHelloWorld {
12
12
public static class Notifier {
13
13
@ Autowired
14
14
private NotificationService service ;
@@ -44,6 +44,6 @@ public NotificationService getNotificationService(){
44
44
public static void main (String [] args ) throws Exception {
45
45
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext (DIConfiguration .class );
46
46
Notifier notifier = context .getBean (Notifier .class );
47
- notifier .send ("test email " ); // Print "I send email: test email "
47
+ notifier .send ("Hello World! " ); // Print "I send email: Hello World! "
48
48
}
49
49
}
Original file line number Diff line number Diff line change 4
4
import org .springframework .context .annotation .Configuration ;
5
5
6
6
/**
7
- * Setter DI injection
7
+ * Setter DI injection Hello World using Java annotation
8
8
*
9
9
* Created by vvedenin on 11/14/2015.
10
10
*/
11
- public class SpringSetterAutowiredTest {
11
+ public class SpringSetterAutowiredHelloWorld {
12
12
public static class Notifier {
13
13
private NotificationService service ;
14
14
@@ -48,6 +48,6 @@ public NotificationService getNotificationService(){
48
48
public static void main (String [] args ) throws Exception {
49
49
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext (DIConfiguration .class );
50
50
Notifier notifier = context .getBean (Notifier .class );
51
- notifier .send ("test email " ); // Print "I send email: test email "
51
+ notifier .send ("Hello World! " ); // Print "I send email: Hello World! "
52
52
}
53
53
}
Original file line number Diff line number Diff line change 8
8
import javax .inject .Inject ;
9
9
10
10
/**
11
+ * Hello World using jsr300 annotation
11
12
*
12
13
* Created by vvedenin on 11/14/2015.
13
14
*/
14
- public class SpringSimpleInjectTest {
15
+ public class SpringSimpleInjectHelloWorld {
15
16
public static class Notifier {
16
17
private final NotificationService service ;
17
18
@@ -51,6 +52,6 @@ public NotificationService getNotificationService(){
51
52
public static void main (String [] args ) throws Exception {
52
53
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext (DIConfiguration .class );
53
54
Notifier notifier = context .getBean (Notifier .class );
54
- notifier .send ("test email " ); // Print "I send email: test email "
55
+ notifier .send ("Hello world! " ); // Print "I send email: Hello world! "
55
56
}
56
57
}
Original file line number Diff line number Diff line change 5
5
import org .springframework .context .support .ClassPathXmlApplicationContext ;
6
6
7
7
/**
8
+ * Constructor DI injection Hello World using XML config
8
9
*
9
10
* Created by vvedenin on 11/14/2015.
10
11
*/
11
- public class XmlConstructorAutowiredTest {
12
+ public class XmlConstructorAutowiredHelloWorld {
12
13
public static class Notifier {
13
14
private final NotificationService service ;
14
15
@@ -36,6 +37,6 @@ public static void main(String[] args) throws Exception {
36
37
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext (
37
38
"constructorAutowired.xml" );
38
39
Notifier notifier = context .getBean (Notifier .class );
39
- notifier .send ("test email " ); // Print "I send email: test email "
40
+ notifier .send ("Hello world! " ); // Print "I send email: Hello world! "
40
41
}
41
42
}
Original file line number Diff line number Diff line change 5
5
import org .springframework .context .support .ClassPathXmlApplicationContext ;
6
6
7
7
/**
8
+ * Field DI injection Hello World using XML config
8
9
*
9
10
* Created by vvedenin on 11/14/2015.
10
11
*/
11
- public class XmlFieldAutowiredTest {
12
+ public class XmlFieldAutowiredHelloWorld {
12
13
public static class Notifier {
13
14
@ Autowired
14
15
private NotificationService service ;
@@ -36,6 +37,6 @@ public static void main(String[] args) throws Exception {
36
37
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext (
37
38
"fieldAutowired.xml" );
38
39
Notifier notifier = context .getBean (Notifier .class );
39
- notifier .send ("test email " ); // Print "I send email: test email "
40
+ notifier .send ("Hello world! " ); // Print "I send email: Hello world! "
40
41
}
41
42
}
You can’t perform that action at this time.
0 commit comments