This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class LifeCycleDemoBeanPostProcessor implements BeanPostProcessor { | |
@Override | |
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { | |
if(bean instanceof LifeCycleDemoBean){ | |
((LifeCycleDemoBean) bean).beforeInit(); | |
} | |
return bean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class LifeCycleDemoBean implements InitializingBean, DisposableBean, BeanNameAware, | |
BeanFactoryAware, ApplicationContextAware { | |
public LifeCycleDemoBean() { | |
System.out.println("## 1. I'm in the LifeCycleBean Constructor"); | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String json = "{\"name\":\"car2\",\"keyA\":1,\"keyB\":2,\"wheels\":null,\"atomicCounter\":0,\"counter\":0,\"brand\":\"car brand\"}\n"; | |
// static objectMapper | |
Stopwatch stopwatch = Stopwatch.createStarted(); | |
List<CompletableFuture<Car>> futureList = new ArrayList<>(); | |
for (int i =0; i < 9; i++) { | |
CompletableFuture<Car> future = CompletableFuture.supplyAsync(() -> { | |
// JsonUtil.toObject is a method to get static objectMapper and execute 'readvalue' | |
return JsonUtil.toObject(json, new TypeReference<Car>() {}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
php-fpm: | |
image: php:7.2-fpm-alpine | |
container_name: php-fpm | |
volumes: | |
- .:/var/www/html | |
- ./www.conf:/usr/local/etc/php-fpm.d/www.conf | |
ports: | |
- 9000:9000 |