com.mizhousoft.commons.context.util.ServiceContextHolder Maven / Gradle / Ivy
package com.mizhousoft.commons.context.util;
import com.mizhousoft.commons.context.support.ApplicationContextRegistration;
/**
* ContextHolder
*
* @version
*/
public class ServiceContextHolder
{
/**
* 获取服务
*
* @param name
* @return
*/
public static Object getService(String name)
{
return ApplicationContextRegistration.getBean(name);
}
/**
* 获取服务
*
* @param
*
* @param clazz
* @return
*/
public static T getService(Class clazz)
{
return ApplicationContextRegistration.getBean(clazz);
}
}