Skip to content

Commit 2f331ce

Browse files
committed
Minor changes after review
1 parent 623c2a0 commit 2f331ce

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎spring-all/src/main/java/org/baeldung/startup/AllStrategiesExampleBean.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
import org.apache.log4j.Logger;
44
import org.springframework.beans.factory.InitializingBean;
5+
import org.springframework.context.annotation.Scope;
6+
import org.springframework.stereotype.Component;
57

68
import javax.annotation.PostConstruct;
79

10+
@Component
11+
@Scope(value = "prototype")
812
public class AllStrategiesExampleBean implements InitializingBean {
913

1014
private static final Logger LOG = Logger.getLogger(AllStrategiesExampleBean.class);

‎spring-all/src/main/java/org/baeldung/startup/InitMethodExampleBean.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
import org.apache.log4j.Logger;
44
import org.springframework.beans.factory.annotation.Autowired;
5+
import org.springframework.context.annotation.Scope;
56
import org.springframework.core.env.Environment;
7+
import org.springframework.stereotype.Component;
68

79
import java.util.Arrays;
810

11+
@Component
12+
@Scope(value = "prototype")
913
public class InitMethodExampleBean {
1014

1115
private static final Logger LOG = Logger.getLogger(InitMethodExampleBean.class);
@@ -17,4 +21,3 @@ public void init() {
1721
LOG.info(Arrays.asList(environment.getDefaultProfiles()));
1822
}
1923
}
20-

0 commit comments

Comments
 (0)