1.1 --- a/samples/componentinjection/anagram-modular/build.xml Sat Jun 14 10:07:17 2008 +0200
1.2 +++ b/samples/componentinjection/anagram-modular/build.xml Sat Jun 14 10:07:21 2008 +0200
1.3 @@ -36,6 +36,10 @@
1.4 <param name="cp" value="build/api/classes:build/word-static/classes:build/scrambler-simple/classes:build/gui/classes:../../libs/dist/spring-2.5.jar"/>
1.5 </antcall>
1.6 <antcall target="-build-one">
1.7 + <param name="version" value="app-spring-scan"/>
1.8 + <param name="cp" value="build/api/classes:build/word-static/classes:build/scrambler-simple/classes:build/gui/classes:../../libs/dist/spring-2.5.jar"/>
1.9 + </antcall>
1.10 + <antcall target="-build-one">
1.11 <param name="version" value="app-lookup"/>
1.12 <param name="cp" value="build/api/classes:build/word-static/classes:build/scrambler-simple/classes:build/gui/classes"/>
1.13 </antcall>
1.14 @@ -61,6 +65,12 @@
1.15 <param name="cp" value="build/api/classes:build/word-static/classes:build/scrambler-simple/classes:build/gui/classes:../../libs/dist/spring-2.5.jar:../../libs/dist/commons-logging-1.1.jar"/>
1.16 <param name="main" value="org.apidesign.anagram.app.spring.Main"/>
1.17 </antcall>
1.18 + <echo level="info" message="Running spring autoscan version"/>
1.19 + <antcall target="-run-one">
1.20 + <param name="version" value="app-spring-scan"/>
1.21 + <param name="cp" value="build/api/classes:build/word-static/classes:build/scrambler-simple/classes:build/gui/classes:../../libs/dist/spring-2.5.jar:../../libs/dist/commons-logging-1.1.jar"/>
1.22 + <param name="main" value="org.apidesign.anagram.app.springscan.Main"/>
1.23 + </antcall>
1.24 <echo level="info" message="Running registerGeneral version"/>
1.25 <antcall target="-run-one">
1.26 <param name="version" value="app-register-general"/>
2.1 --- a/samples/componentinjection/anagram-modular/nbproject/project.xml Sat Jun 14 10:07:17 2008 +0200
2.2 +++ b/samples/componentinjection/anagram-modular/nbproject/project.xml Sat Jun 14 10:07:21 2008 +0200
2.3 @@ -58,6 +58,12 @@
2.4 <encoding>UTF-8</encoding>
2.5 </source-folder>
2.6 <source-folder>
2.7 + <label>src-app-spring-scan</label>
2.8 + <type>java</type>
2.9 + <location>src-app-spring-scan</location>
2.10 + <encoding>UTF-8</encoding>
2.11 + </source-folder>
2.12 + <source-folder>
2.13 <label>src-app-lookup</label>
2.14 <type>java</type>
2.15 <location>src-app-lookup</location>
2.16 @@ -135,6 +141,10 @@
2.17 <location>src-app-spring</location>
2.18 </source-folder>
2.19 <source-folder style="packages">
2.20 + <label>src-app-spring-scan</label>
2.21 + <location>src-app-spring-scan</location>
2.22 + </source-folder>
2.23 + <source-folder style="packages">
2.24 <label>src-app-lookup</label>
2.25 <location>src-app-lookup</location>
2.26 </source-folder>
2.27 @@ -201,6 +211,12 @@
2.28 <source-level>1.5</source-level>
2.29 </compilation-unit>
2.30 <compilation-unit>
2.31 + <package-root>src-app-spring-scan</package-root>
2.32 + <classpath mode="compile">src-api:src-scrambler-simple:src-word-static:src-gui:../../libs/dist/spring-2.5.jar</classpath>
2.33 + <built-to>build/app-spring-scan/classes</built-to>
2.34 + <source-level>1.5</source-level>
2.35 + </compilation-unit>
2.36 + <compilation-unit>
2.37 <package-root>src-app-lookup</package-root>
2.38 <classpath mode="compile">src-api:src-scrambler-simple:src-word-static:src-gui:../../libs/dist/org-openide-util.jar</classpath>
2.39 <built-to>build/app-lookup/classes</built-to>
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/samples/componentinjection/anagram-modular/src-app-spring-scan/org/apidesign/anagram/app/springscan/AnagramsAnnotated.java Sat Jun 14 10:07:21 2008 +0200
3.3 @@ -0,0 +1,22 @@
3.4 +package org.apidesign.anagram.app.springscan;
3.5 +
3.6 +import org.apidesign.anagram.api.Scrambler;
3.7 +import org.apidesign.anagram.api.WordLibrary;
3.8 +import org.apidesign.anagram.gui.AnagramsWithConstructor;
3.9 +import org.springframework.beans.factory.annotation.Autowired;
3.10 +import org.springframework.stereotype.Service;
3.11 +
3.12 +/* This class shall be in its own module, not here, but because of the need
3.13 + * to see the @Service annotation, I've put it here. The right solution would
3.14 + * be to add dependency of the module providing super class on spring and
3.15 + * use the annotation directly there.
3.16 + */
3.17 +
3.18 +@Service("ui")
3.19 +public class AnagramsAnnotated extends AnagramsWithConstructor {
3.20 + @Autowired
3.21 + public AnagramsAnnotated(WordLibrary library, Scrambler scrambler) {
3.22 + super(library, scrambler);
3.23 + }
3.24 +
3.25 +}
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/samples/componentinjection/anagram-modular/src-app-spring-scan/org/apidesign/anagram/app/springscan/Main.java Sat Jun 14 10:07:21 2008 +0200
4.3 @@ -0,0 +1,17 @@
4.4 +package org.apidesign.anagram.app.springscan;
4.5 +
4.6 +import org.apidesign.anagram.api.UI;
4.7 +import org.springframework.context.ApplicationContext;
4.8 +import org.springframework.context.support.ClassPathXmlApplicationContext;
4.9 +
4.10 +public final class Main {
4.11 + private Main() { }
4.12 +
4.13 + public static void main(String[] args) throws Exception {
4.14 + ApplicationContext context = new ClassPathXmlApplicationContext(
4.15 + "org/apidesign/anagram/app/springscan/conf.xml"
4.16 + );
4.17 + UI ui = (UI)context.getBean("ui", UI.class);
4.18 + ui.display();
4.19 + }
4.20 +}
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/samples/componentinjection/anagram-modular/src-app-spring-scan/org/apidesign/anagram/app/springscan/SimpleScramblerAnnotated.java Sat Jun 14 10:07:21 2008 +0200
5.3 @@ -0,0 +1,15 @@
5.4 +package org.apidesign.anagram.app.springscan;
5.5 +
5.6 +import org.apidesign.anagram.scramblersimple.SimpleScrambler;
5.7 +import org.springframework.stereotype.Service;
5.8 +
5.9 +/* This class shall be in its own module, not here, but because of the need
5.10 + * to see the @Service annotation, I've put it here. The right solution would
5.11 + * be to add dependency of the module providing super class on spring and
5.12 + * use the annotation directly there.
5.13 + */
5.14 +
5.15 +
5.16 +@Service
5.17 +public class SimpleScramblerAnnotated extends SimpleScrambler {
5.18 +}
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/samples/componentinjection/anagram-modular/src-app-spring-scan/org/apidesign/anagram/app/springscan/StaticWordLibraryAnnotated.java Sat Jun 14 10:07:21 2008 +0200
6.3 @@ -0,0 +1,15 @@
6.4 +package org.apidesign.anagram.app.springscan;
6.5 +
6.6 +import org.apidesign.anagram.wordstatic.StaticWordLibrary;
6.7 +import org.springframework.stereotype.Service;
6.8 +
6.9 +/* This class shall be in its own module, not here, but because of the need
6.10 + * to see the @Service annotation, I've put it here. The right solution would
6.11 + * be to add dependency of the module providing super class on spring and
6.12 + * use the annotation directly there.
6.13 + */
6.14 +
6.15 +
6.16 +@Service
6.17 +public class StaticWordLibraryAnnotated extends StaticWordLibrary {
6.18 +}
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/samples/componentinjection/anagram-modular/src-app-spring-scan/org/apidesign/anagram/app/springscan/conf.xml Sat Jun 14 10:07:21 2008 +0200
7.3 @@ -0,0 +1,12 @@
7.4 +<?xml version="1.0" encoding="UTF-8"?>
7.5 +<beans xmlns="http://www.springframework.org/schema/beans"
7.6 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7.7 + xmlns:context="http://www.springframework.org/schema/context"
7.8 + xsi:schemaLocation="http://www.springframework.org/schema/beans
7.9 + http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
7.10 + http://www.springframework.org/schema/context
7.11 + http://www.springframework.org/schema/context/spring-context-2.5.xsd">
7.12 +
7.13 + <context:component-scan base-package="org.apidesign.anagram.app"/>
7.14 +
7.15 +</beans>
7.16 \ No newline at end of file
8.1 --- a/samples/componentinjection/anagram-modular/src-gui/org/apidesign/anagram/gui/AnagramsWithConstructor.java Sat Jun 14 10:07:17 2008 +0200
8.2 +++ b/samples/componentinjection/anagram-modular/src-gui/org/apidesign/anagram/gui/AnagramsWithConstructor.java Sat Jun 14 10:07:21 2008 +0200
8.3 @@ -3,7 +3,7 @@
8.4 import org.apidesign.anagram.api.Scrambler;
8.5 import org.apidesign.anagram.api.WordLibrary;
8.6
8.7 -public final class AnagramsWithConstructor extends Anagrams {
8.8 +public class AnagramsWithConstructor extends Anagrams {
8.9
8.10 private final WordLibrary library;
8.11 private final Scrambler scrambler;
9.1 --- a/samples/componentinjection/anagram-modular/src-scrambler-simple/org/apidesign/anagram/scramblersimple/SimpleScrambler.java Sat Jun 14 10:07:17 2008 +0200
9.2 +++ b/samples/componentinjection/anagram-modular/src-scrambler-simple/org/apidesign/anagram/scramblersimple/SimpleScrambler.java Sat Jun 14 10:07:21 2008 +0200
9.3 @@ -3,7 +3,7 @@
9.4 import java.util.Random;
9.5 import org.apidesign.anagram.api.Scrambler;
9.6
9.7 -public final class SimpleScrambler implements Scrambler {
9.8 +public class SimpleScrambler implements Scrambler {
9.9 private static final Random random = new Random();
9.10
9.11 public String scramble(String word) {
10.1 --- a/samples/componentinjection/anagram-modular/src-word-static/org/apidesign/anagram/wordstatic/StaticWordLibrary.java Sat Jun 14 10:07:17 2008 +0200
10.2 +++ b/samples/componentinjection/anagram-modular/src-word-static/org/apidesign/anagram/wordstatic/StaticWordLibrary.java Sat Jun 14 10:07:21 2008 +0200
10.3 @@ -4,7 +4,7 @@
10.4 import org.apidesign.anagram.api.WordLibrary;
10.5
10.6
10.7 -public final class StaticWordLibrary implements WordLibrary {
10.8 +public class StaticWordLibrary implements WordLibrary {
10.9 private static String wordList[] = {
10.10 "abstraction",
10.11 "ambiguous",