Java org.springframework.context.annotation AnnotationConfigApplicationContext fields, constructors, methods, implement or subclass

Example usage for Java org.springframework.context.annotation AnnotationConfigApplicationContext fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.springframework.context.annotation AnnotationConfigApplicationContext.

The text is from its open source code.

Subclass

org.springframework.context.annotation.AnnotationConfigApplicationContext has subclasses.
Click this link to see all its subclasses.

Constructor

AnnotationConfigApplicationContext(DefaultListableBeanFactory beanFactory)
Create a new AnnotationConfigApplicationContext with the given DefaultListableBeanFactory.
AnnotationConfigApplicationContext(Class... annotatedClasses)
Create a new AnnotationConfigApplicationContext, deriving bean definitions from the given annotated classes and automatically refreshing the context.
AnnotationConfigApplicationContext(String... basePackages)
Create a new AnnotationConfigApplicationContext, scanning for bean definitions in the given packages and automatically refreshing the context.
AnnotationConfigApplicationContext()
Create a new AnnotationConfigApplicationContext that needs to be populated through #register calls and then manually #refresh refreshed .

Method

voidaddApplicationListener(ApplicationListener listener)
voidaddBeanFactoryPostProcessor(BeanFactoryPostProcessor postProcessor)
voidclose()
Close this application context, destroying all beans in its bean factory.
booleancontainsBean(String name)
voiddestroy()
Callback for destruction of this instance, originally attached to a DisposableBean implementation (not anymore in 5.0).
AutowireCapableBeanFactorygetAutowireCapableBeanFactory()
TgetBean(String name, Class requiredType)
ObjectgetBean(String name)
String[]getBeanDefinitionNames()
ConfigurableListableBeanFactorygetBeanFactory()
Return the single internal BeanFactory held by this context (as ConfigurableListableBeanFactory).
ListgetBeanFactoryPostProcessors()
Return the list of BeanFactoryPostProcessors that will get applied to the internal BeanFactory.
String[]getBeanNamesForType(ResolvableType type)
MapgetBeansOfType(@Nullable Class type)
MapgetBeansWithAnnotation(Class annotationType)
DefaultListableBeanFactorygetDefaultListableBeanFactory()
Return the underlying bean factory of this context, available for registering bean definitions.
ConfigurableEnvironmentgetEnvironment()
Return the Environment for this application context in configurable form, allowing for further customization.
StringgetId()
booleanisPrototype(String name)
booleanisRunning()
booleanisSingleton(String name)
voidrefresh()
voidregister(Class... annotatedClasses)
Register one or more annotated classes to be processed.
voidregisterBeanDefinition(String beanName, BeanDefinition beanDefinition)
voidregisterShutdownHook()
Register a shutdown hook with the JVM runtime, closing this context on JVM shutdown unless it has already been closed at that time.
voidscan(String... basePackages)
Perform a scan within the specified base packages.
voidsetAllowBeanDefinitionOverriding(boolean allowBeanDefinitionOverriding)
Set whether it should be allowed to override bean definitions by registering a different definition with the same name, automatically replacing the former.
voidsetAllowCircularReferences(boolean allowCircularReferences)
Set whether to allow circular references between beans - and automatically try to resolve them.
voidsetClassLoader(@Nullable ClassLoader classLoader)
voidsetDisplayName(String displayName)
Set a friendly name for this context.
voidsetEnvironment(ConfigurableEnvironment environment)
Propagates the given custom Environment to the underlying AnnotatedBeanDefinitionReader and ClassPathBeanDefinitionScanner .
voidsetId(String id)
Set the unique id of this application context.
voidsetParent(@Nullable ApplicationContext parent)
Set the parent of this application context, also setting the parent of the internal BeanFactory accordingly.
voidsetResourceLoader(ResourceLoader resourceLoader)
Set a ResourceLoader to use for this context.
voidstart()
voidstop()