1 22 23 package org.jboss.tutorial.ee.service.impl; 24 25 import javax.ejb.Stateless ; 26 27 import org.jboss.annotation.spring.Spring; 28 import org.jboss.tutorial.ee.service.Randomizer; 29 import org.jboss.tutorial.spring.IntCreator; 30 import org.jboss.tutorial.spring.WordsCreator; 31 32 35 @Stateless 36 public class RandomizerBean implements Randomizer 37 { 38 39 private WordsCreator wordsCreator; 40 41 @Spring(jndiName = "spring-pojo", bean = "stateIntCreator") 42 private IntCreator intCreator; 43 44 public WordsCreator getWordsCreator() 45 { 46 return wordsCreator; 47 } 48 49 @Spring(jndiName = "spring-pojo", bean = "staticWordsCreator") 50 public void setWordsCreator(WordsCreator wordsCreator) 51 { 52 this.wordsCreator = wordsCreator; 53 } 54 55 public int getNumber(int radius) 56 { 57 return intCreator.createInt(radius); 58 } 59 60 public String getWord() 61 { 62 return getWordsCreator().createWord(); 63 } 64 65 } 66 | Popular Tags |