All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fit2cloud.quartz.util.QuartzBeanFactory Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
package com.fit2cloud.quartz.util;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class QuartzBeanFactory implements ApplicationContextAware {
    private static ApplicationContext applicationContext;

    public static  T getBean(Class tClass) {
        return applicationContext.getBean(tClass);
    }

    public static  T getBean(String beanName) {
        return (T) applicationContext.getBean(beanName);
    }

    public static  T getBean(String beanName, Class tClass) {
        return applicationContext.getBean(beanName, tClass);
    }


    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        QuartzBeanFactory.applicationContext = applicationContext;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy