mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-08 21:38:21 +00:00
23 lines
559 B
Java
23 lines
559 B
Java
package tech.ailef.dbadmin;
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
import org.springframework.context.ApplicationContextAware;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
/**
|
|
* Utility class the get the ApplicationContext
|
|
*/
|
|
@Component
|
|
public class ApplicationContextUtils implements ApplicationContextAware {
|
|
|
|
private static ApplicationContext ctx;
|
|
|
|
@Override
|
|
public void setApplicationContext(ApplicationContext appContext) {
|
|
ctx = appContext;
|
|
}
|
|
|
|
public static ApplicationContext getApplicationContext() {
|
|
return ctx;
|
|
}
|
|
} |