Example usage for Java org.springframework.context.support GenericApplicationContext fields, constructors, methods, implement or subclass
The text is from its open source code.
GenericApplicationContext() Create a new GenericApplicationContext. | |
GenericApplicationContext(DefaultListableBeanFactory beanFactory) Create a new GenericApplicationContext with the given DefaultListableBeanFactory. | |
GenericApplicationContext(@Nullable ApplicationContext parent) Create a new GenericApplicationContext with the given parent. |
void | addApplicationListener(ApplicationListener> listener) |
void | addBeanFactoryPostProcessor(BeanFactoryPostProcessor postProcessor) |
void | close() Close this application context, destroying all beans in its bean factory. |
boolean | containsBean(String name) |
String[] | getAliases(String name) |
AutowireCapableBeanFactory | getAutowireCapableBeanFactory() |
T | getBean(String name, Class |
Object | getBean(String name) |
BeanDefinition | getBeanDefinition(String beanName) |
String[] | getBeanDefinitionNames() |
ConfigurableListableBeanFactory | getBeanFactory() Return the single internal BeanFactory held by this context (as ConfigurableListableBeanFactory). |
List | getBeanFactoryPostProcessors() Return the list of BeanFactoryPostProcessors that will get applied to the internal BeanFactory. |
String[] | getBeanNamesForType(ResolvableType type) |
ObjectProvider | getBeanProvider(Class |
Map | getBeansOfType(@Nullable Class |
DefaultListableBeanFactory | getDefaultListableBeanFactory() Return the underlying bean factory of this context, available for registering bean definitions. |
ConfigurableEnvironment | getEnvironment() Return the Environment for this application context in configurable form, allowing for further customization. |
ApplicationContext | getParent() Return the parent context, or null if there is no parent (that is, this context is the root of the context hierarchy). |
Resource | getResource(String location) This implementation delegates to this context's ResourceLoader if set, falling back to the default superclass behavior else. |
Resource[] | getResources(String locationPattern) This implementation delegates to this context's ResourceLoader if it implements the ResourcePatternResolver interface, falling back to the default superclass behavior else. |
Class> | getType(String name) |
boolean | isActive() |
void | publishEvent(ApplicationEvent event) Publish the given event to all listeners. |
void | refresh() |
void | registerAlias(String beanName, String alias) |
void | registerBean(Class Register a bean from the given bean class, optionally providing explicit constructor arguments for consideration in the autowiring process. |
void | registerBean(Class Register a bean from the given bean class, optionally customizing its bean definition metadata (typically declared as a lambda expression). |
void | registerBeanDefinition(String beanName, BeanDefinition beanDefinition) |
void | registerShutdownHook() Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time. |
void | setClassLoader(@Nullable ClassLoader classLoader) |
void | setDisplayName(String displayName) Set a friendly name for this context. |
void | setParent(@Nullable ApplicationContext parent) Set the parent of this application context, also setting the parent of the internal BeanFactory accordingly. |
void | setResourceLoader(ResourceLoader resourceLoader) Set a ResourceLoader to use for this context. |
void | start() |