public class SpringContextUtil extends Object implements org.springframework.context.ApplicationContextAware
| Constructor and Description |
|---|
SpringContextUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getBean(Class<T> clazz) |
static <T> T |
getBean(String beanName) |
static <T> T |
getBean(String beanName,
Class<T> clazz) |
static <T> org.springframework.beans.factory.ObjectProvider<T> |
getBeanProvider(Class<T> clazz) |
static <T> org.springframework.beans.factory.ObjectProvider<T> |
getBeanProvider(org.springframework.core.ResolvableType resolvableType) |
static org.springframework.context.ApplicationContext |
getContext() |
static <T> T |
getCurrentProxy()
获取aop代理对象
|
static void |
publishEvent(org.springframework.context.ApplicationEvent event) |
static void |
publishEvent(Object event) |
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
public void setApplicationContext(org.springframework.context.ApplicationContext context)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansException@Nullable public static <T> T getBean(Class<T> clazz)
@Nullable public static <T> T getBean(String beanName)
@Nullable public static <T> org.springframework.beans.factory.ObjectProvider<T> getBeanProvider(Class<T> clazz)
@Nullable public static <T> org.springframework.beans.factory.ObjectProvider<T> getBeanProvider(org.springframework.core.ResolvableType resolvableType)
@Nullable public static org.springframework.context.ApplicationContext getContext()
public static void publishEvent(org.springframework.context.ApplicationEvent event)
public static void publishEvent(Object event)
public static <T> T getCurrentProxy()
Copyright © 2024. All rights reserved.