com.github.bingoohuang.sqltrigger.spring.SpringBeanFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sql-trigger Show documentation
Show all versions of sql-trigger Show documentation
delay queue based on redis
The newest version!
package com.github.bingoohuang.sqltrigger.spring;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
import java.util.Collection;
@Component
public class SpringBeanFactory implements ApplicationContextAware {
private static ApplicationContext appContext;
public static Collection getBeans(Class clazz) {
return appContext.getBeansOfType(clazz).values();
}
@Override public void setApplicationContext(ApplicationContext appContext) {
this.appContext = appContext;
}
public static boolean isSpringEnabled() {
return appContext != null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy