Add AllStrategies combined example
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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);
|
||||
|
||||
public AllStrategiesExampleBean() {
|
||||
LOG.info("Constructor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
LOG.info("InitializingBean");
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void postConstruct() {
|
||||
LOG.info("PostConstruct");
|
||||
}
|
||||
|
||||
public void init() {
|
||||
LOG.info("init-method");
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,10 @@ 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);
|
||||
|
||||
Reference in New Issue
Block a user