Spring
Java · 27 notes
- 2.10 Spring Moduleshistorical
Spring Framework consists of multiple modules, with its core layer providing container capabilities. These notes organize responsibilities by module.
- ApplicationListenerhistorical
ApplicationListener uses the observer pattern to decouple event publishers from listeners. These notes illustrate it with separate email and logging actions after ticket events.
- Bean Scopeshistorical
Singleton scope returns the same bean from the container, while prototype scope creates a new instance each time. These notes examine scope behavior.
- Usagehistorical
Examples such as HelloWorld demonstrate Spring AOP usage and the relationship between aspect configuration and target-method calls.
- Usagehistorical
Examples such as AopConfig and Calc demonstrate Spring AOP configuration and how aspects work with target objects.
- 2.32 Autowired Principlehistorical
Spring handles dependency injection during post-processor registration and bean creation. These notes trace @Autowired through AutowiredAnnotationBeanPostProcessor.
- Spring Transaction Source Analysishistorical
@EnableTransactionManagement imports transaction-management components. These notes trace registration and execution of Spring transaction objects from that annotation.
- Bean Lifecyclehistorical
A Spring bean is instantiated and then undergoes property injection and further processing. These notes organize its lifecycle stages and extension points.
- What Spring AOP Ishistorical
AOP adds cross-cutting behavior without directly changing business code. These notes use logging to explain separating aspects from business logic.
- What It Ishistorical
IOC delegates object creation and management to a container, from which business code obtains dependencies. These notes compare that arrangement with manual construction.
- 2.47 Common Spring Annotationshistorical
Spring annotations declare configuration classes, scan components, and register objects in the IOC container. These notes organize common annotations and their usage.
- Spring Transaction Propagationhistorical
Transaction propagation behavior is an enhancement that Spring provides on top of database transactions. It describes how a transaction propagates when a method annotated with a particular propagation behavior is nested inside another method.
- BeanFactoryhistorical
BeanFactory instantiates, configures, and manages beans, while ApplicationContext adds further capabilities. These notes examine relationships among container interfaces.
- 2.53 Usagehistorical
DbConfig and Service examples demonstrate Spring transaction usage and the relationship between data-source configuration and transactional methods.
- Circular Dependencieshistorical
Circular Dependencies: Suppose there are two Beans, Bean1 and Bean2. If Bean1 depends on Bean2, and Bean2 depends on Bean1, then when Spring creates Bean1 it first needs to create Bean2, while creating Bean2 requires creating Bean1 first.
- How to Load Beans A and B in Order in Springhistorical
Controller and Service examples examine loading relationships between Spring beans and ways to control their initialization order.
- 1. Create the Spring Containerhistorical
Creating a Spring container triggers refresh. These notes trace container initialization and bean retrieval from ApplicationContext creation.
- 2. Call BeanFactoryPostProcessor's postProcess Methodhistorical
Spring invokes BeanFactoryPostProcessors during container refresh. These notes trace their execution from invokeBeanFactoryPostProcessors.
- 3. Register BeanPostProcessorhistorical
Spring registers bean post-processors through registerBeanPostProcessors. These notes follow the delegated calls that perform registration.
- Spring IoC Source: Instantiating All Non-Lazy Singleton Beanshistorical
FinishBeanFactoryInitialization instantiates non-lazy singleton beans. These notes focus on the execution of preInstantiateSingletons.
- UML Diagramhistorical
UML diagrams organize relationships among Spring IOC classes as a structural reference for reading container source code.
- 1. Inject AspectJAnnotationAutoProxyCreator into the Containerhistorical
Enabling @EnableAspectJAutoProxy imports AOP components into Spring. These notes trace automatic proxy creator registration from the annotation's source.
- 2.1 How the AnnotationAwareAspectJAutoProxyCreator Bean Instance Is Createdhistorical
AnnotationAwareAspectJAutoProxyCreator is both a bean post-processor and BeanFactoryAware. These notes use breakpoints to examine its creation and initialization.
- Spring AOP Source Analysis Summaryhistorical
Spring AOP's automatic proxy creator participates in bean initialization and generates proxies at the relevant stage. This page summarizes related interfaces and call relationships.
- 2.2 When Does AnnotationAwareAspectJAutoProxyCreator Take Effect?historical
Breakpoints around bean initialization show when AnnotationAwareAspectJAutoProxyCreator participates in the bean lifecycle.
- 2.3 How AnnotationAwareAspectJAutoProxyCreator Creates Proxy Objectshistorical
These notes follow target-bean creation through the automatic proxy creator to examine aspect checks and proxy generation.
- 2.4 How the Target Method Is Executedhistorical
Calls to a proxied target enter an interceptor. These notes trace the interceptor chain and target execution from CglibAopProxy.intercept.