Package api.log.base
Class ContextUtil
java.lang.Object
api.log.base.ContextUtil
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@Component
public class ContextUtil
extends Object
implements org.springframework.context.ApplicationContextAware
上下文工具
- Author:
- chenenwei
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T获取beanvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) 设置ApplicationContext
-
Constructor Details
-
ContextUtil
public ContextUtil()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException 设置ApplicationContext- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Parameters:
applicationContext- applicationContext- Throws:
org.springframework.beans.BeansException- 异常
-
getBean
获取bean- Type Parameters:
T- 泛型- Parameters:
beanClass- beanClass- Returns:
- bean
-