From 2f331cecf808b7232818d91101d50faddaf25fa0 Mon Sep 17 00:00:00 2001 From: Alex Theedom Date: Mon, 15 Aug 2016 18:47:23 +0100 Subject: [PATCH] Minor changes after review --- .../java/org/baeldung/startup/AllStrategiesExampleBean.java | 4 ++++ .../java/org/baeldung/startup/InitMethodExampleBean.java | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spring-all/src/main/java/org/baeldung/startup/AllStrategiesExampleBean.java b/spring-all/src/main/java/org/baeldung/startup/AllStrategiesExampleBean.java index 64af2d520c..d4334437f7 100644 --- a/spring-all/src/main/java/org/baeldung/startup/AllStrategiesExampleBean.java +++ b/spring-all/src/main/java/org/baeldung/startup/AllStrategiesExampleBean.java @@ -2,9 +2,13 @@ package org.baeldung.startup; import org.apache.log4j.Logger; import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; +@Component +@Scope(value = "prototype") public class AllStrategiesExampleBean implements InitializingBean { private static final Logger LOG = Logger.getLogger(AllStrategiesExampleBean.class); diff --git a/spring-all/src/main/java/org/baeldung/startup/InitMethodExampleBean.java b/spring-all/src/main/java/org/baeldung/startup/InitMethodExampleBean.java index ea0a85d261..cea6b026d6 100644 --- a/spring-all/src/main/java/org/baeldung/startup/InitMethodExampleBean.java +++ b/spring-all/src/main/java/org/baeldung/startup/InitMethodExampleBean.java @@ -2,10 +2,14 @@ package org.baeldung.startup; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; import java.util.Arrays; +@Component +@Scope(value = "prototype") public class InitMethodExampleBean { private static final Logger LOG = Logger.getLogger(InitMethodExampleBean.class); @@ -17,4 +21,3 @@ public class InitMethodExampleBean { LOG.info(Arrays.asList(environment.getDefaultProfiles())); } } -