i want the annotation-based Service created and be put to a map.
let's take it for example:
However, i don't want the implemention that like this.Code:@Service public class SimpleMovieLister { private MovieFinder movieFinder; @Autowired public SimpleMovieLister(MovieFinder movieFinder) { this.movieFinder = movieFinder; } } @Repository public class JpaMovieFinder implements MovieFinder { // implementation elided for clarity }
Is there any interface in spring to let me add the code after annotation-based bean be created.Code:@Service public class SimpleMovieLister implements InitializingBean{ private Map<?, ?> map = null; //.... @Override public void afterPropertiesSet() throws Exception { // TODO Auto-generated method stub map.put(getServiceName(), this); } }
give me some advice, thx


Reply With Quote
