samples/componentinjection/anagram-modular/src-app-spring-scan/org/apidesign/anagram/app/springscan/AnagramsAnnotated.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 10:07:21 +0200
changeset 230 3282ef5328a8
child 237 a84441ff1f73
permissions -rw-r--r--
Yet another example of spring autoconfiguration
     1 package org.apidesign.anagram.app.springscan;
     2 
     3 import org.apidesign.anagram.api.Scrambler;
     4 import org.apidesign.anagram.api.WordLibrary;
     5 import org.apidesign.anagram.gui.AnagramsWithConstructor;
     6 import org.springframework.beans.factory.annotation.Autowired;
     7 import org.springframework.stereotype.Service;
     8 
     9 /* This class shall be in its own module, not here, but because of the need
    10  * to see the @Service annotation, I've put it here. The right solution would
    11  * be to add dependency of the module providing super class on spring and
    12  * use the annotation directly there.
    13  */
    14 
    15 @Service("ui")
    16 public class AnagramsAnnotated extends AnagramsWithConstructor {
    17     @Autowired
    18     public AnagramsAnnotated(WordLibrary library, Scrambler scrambler) {
    19         super(library, scrambler);
    20     }
    21 
    22 }