Use scope prototype
This commit is contained in:
parent
f755fce0bb
commit
cd2ee40c06
|
@ -2,7 +2,9 @@ package org.baeldung.startup;
|
|||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Scope(value = "prototype")
|
||||
public class InitializingBeanExampleBean implements InitializingBean {
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package org.baeldung.startup;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Scope(value = "prototype")
|
||||
public class PostConstructExampleBean {
|
||||
|
||||
@Autowired
|
||||
|
|
Loading…
Reference in New Issue