Skip to content

Instantly share code, notes, and snippets.

View salprima's full-sized avatar
👁️
I Code You Like I Love You

Sal Prima salprima

👁️
I Code You Like I Love You
View GitHub Profile
@salprima
salprima / ApplicationContextHolder.java
Created July 27, 2018 08:09 — forked from ufuk/ApplicationContextHolder.java
Utility bean for getting Spring beans from static context.
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class ApplicationContextHolder implements ApplicationContextAware {
private static ApplicationContext applicationContext;