@startuml
Title "Beanfactory 抽象关系"
interface BeanFactory
interface ListableBeanFactory
interface ConfigurableApplicationContext
abstract class AbstractApplicationContext
class GenericApplicationContext

BeanFactory <|.. ListableBeanFactory
ListableBeanFactory <|-- ConfigurableApplicationContext
ConfigurableApplicationContext <|-- AbstractApplicationContext
AbstractApplicationContext <|-- GenericApplicationContext

interface BeanFactory {
+ Object getBean(String name) throws BeansException
+ <T> T getBean(String name, Class<T> requiredType) throws BeansException
+ boolean containsBean(String name)
+ <T> ObjectProvider<T> getBeanProvider(Class<T> requiredType);
+ boolean isSingleton(String name) throws NoSuchBeanDefinitionException
+ boolean isPrototype(String name) throws NoSuchBeanDefinitionException;
+ boolean isTypeMatch(String name, ResolvableType typeToMatch) throws NoSuchBeanDefinitionException
+ Class<?> getType(String name) throws NoSuchBeanDefinitionException
+ String[] getAliases(String name)
}

interface ListableBeanFactory {
+ boolean containsBeanDefinition(String beanName)
+ int getBeanDefinitionCount()
+ String[] getBeanDefinitionNames()
+ String[] getBeanNamesForType(ResolvableType type)
+ String[] getBeanNamesForType(@Nullable Class<?> type)
+ String[] getBeanNamesForType(@Nullable Class<?> type, boolean includeNonSingletons, boolean allowEagerInit)
+ Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType) throws BeansException;
}

interface ConfigurableApplicationContext {
+ ConfigurableEnvironment getEnvironment()
+ void addBeanFactoryPostProcessor(BeanFactoryPostProcessor postProcessor)
+ void addApplicationListener(ApplicationListener<?> listener)
+ void refresh() throws BeansException, IllegalStateException
+ void registerShutdownHook()
+ ConfigurableListableBeanFactory getBeanFactory() throws IllegalStateException
}

abstract class AbstractApplicationContext {
+ public ConfigurableEnvironment getEnvironment()
+ public void addBeanFactoryPostProcessor(BeanFactoryPostProcessor postProcessor)
+ public void addApplicationListener(ApplicationListener<?> listener)
+ public void refresh() throws BeansException, IllegalStateException
+ public void registerShutdownHook()
+ public boolean isSingleton(String name) throws NoSuchBeanDefinitionException
+ public boolean isPrototype(String name) throws NoSuchBeanDefinitionException
+ public boolean containsBean(String name)
+ public boolean containsBeanDefinition(String beanName)
+ public String[] getBeanDefinitionNames()
+ public String[] getBeanNamesForType(ResolvableType type)
+ public public void setParent(@Nullable ApplicationContext parent)
}

class GenericApplicationContext {
+ public void setParent(@Nullable ApplicationContext parent)
+ public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException {
+ public Resource[] getResources(String locationPattern) throws IOException
+ public final <T> void registerBean(
  			@Nullable String beanName, Class<T> beanClass, BeanDefinitionCustomizer... customizers)
}

@enduml
