@Service public class SpringApplicationContext extends Object implements org.springframework.context.ApplicationContextAware
Constructor and Description |
---|
SpringApplicationContext() |
Modifier and Type | Method and Description |
---|---|
static Object |
getBean(String beanName)
Returns the Spring bean, if any, with the given name.
|
static <T> T |
getBeanByType(Class<T> type)
Returns the first Spring bean found that is an instance of the
given class.
|
static org.springframework.context.ApplicationContext |
getContext() |
static <T> List<T> |
listBeansOfType(Class<T> type)
Returns all the Spring beans that are instances of the given type.
|
static <T> Map<String,T> |
mapBeansOfType(Class<T> type)
Returns a map of all the Spring beans that are instances of
the given type.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext appContext) |
public void setApplicationContext(org.springframework.context.ApplicationContext appContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public static Object getBean(String beanName)
public static <T> T getBeanByType(Class<T> type)
public static <T> List<T> listBeansOfType(Class<T> type)
public static <T> Map<String,T> mapBeansOfType(Class<T> type)
public static org.springframework.context.ApplicationContext getContext()
Copyright © 2019 Power TAC. All rights reserved.