revised support for annotated factory methods (merged @FactoryMethod functionality into JavaConfig facility)

This commit is contained in:
Juergen Hoeller
2009-04-19 23:45:31 +00:00
parent 736169aa2a
commit 14bd475519
84 changed files with 2411 additions and 3458 deletions

View File

@@ -21,12 +21,14 @@ import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.AsyncResult;
/**
* @author Mark Fisher
* @author Juergen Hoeller
*/
@Lazy
public class AutowiredQualifierFooService implements FooService {
@Autowired

View File

@@ -27,6 +27,8 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.ResourcePatternResolver;
@@ -38,7 +40,7 @@ import org.springframework.util.Assert;
* @author Mark Fisher
* @author Juergen Hoeller
*/
@Service
@Service @Lazy @DependsOn("myNamedComponent")
public class FooServiceImpl implements FooService {
@Autowired private FooDao fooDao;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,11 +17,12 @@
package example.scannable;
import org.springframework.stereotype.Component;
import org.springframework.context.annotation.Lazy;
/**
* @author Mark Fisher
*/
@Component("myNamedComponent")
@Component("myNamedComponent") @Lazy
public class NamedComponent {
}