Skip to content

Instantly share code, notes, and snippets.

View snicoll's full-sized avatar
🍃
👨‍💻

Stéphane Nicoll snicoll

🍃
👨‍💻
View GitHub Profile
@snicoll
snicoll / blog.md
Last active August 29, 2015 14:15

Application events are available since the very beginning of the Spring framework as a mean for loosely coupled components to exchange information. One of the most well known usage of application events is the following:

@Component
public class MyListener 
        implements ApplicationListener<ContextRefreshedEvent> {
  
    public void onApplicationEvent(ContextRefreshedEvent event) {
        ...
 }
@snicoll
snicoll / CacheConfig.java
Last active February 17, 2018 17:48 — forked from anataliocs/CacheConfig.java
Guava cache with spring boot and clear cache method
import com.google.common.cache.CacheBuilder;
import org.springframework.cache.Cache;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.guava.GuavaCache;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
@Configuration