Use scope prototype

This commit is contained in:
Grzegorz Piwowarek 2016-08-13 13:20:45 +02:00
parent f755fce0bb
commit cd2ee40c06
2 changed files with 4 additions and 0 deletions

View File

@ -2,7 +2,9 @@ package org.baeldung.startup;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component
@Scope(value = "prototype") @Scope(value = "prototype")
public class InitializingBeanExampleBean implements InitializingBean { public class InitializingBeanExampleBean implements InitializingBean {

View File

@ -1,10 +1,12 @@
package org.baeldung.startup; package org.baeldung.startup;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@Component @Component
@Scope(value = "prototype")
public class PostConstructExampleBean { public class PostConstructExampleBean {
@Autowired @Autowired