Framework
Java · 98 notes
- Spring Learning Resourceshistorical
Spring interview questions with detailed answers; how Spring resolves circular dependencies.
- Usagehistorical
Create a Maven project, configure MyBatis, create the mapper, test it, and inspect the project structure
- 2.10 Spring Moduleshistorical
Spring core container, data access/integration, Web, AOP, Instrumentation, Test, and miscellaneous modules.
- Spring Boot Learning Resourceshistorical
20 Spring Boot interview questions - Java Technology Stack - SegmentFault.
- 2.12 Usagehistorical
Create a Spring MVC project in two ways, configure Maven and Spring MVC, add controllers/JSP/HTML, configure Tomcat, and run the project.
- MyBatis Source Analysishistorical
Framework layers, four core objects, SqlSessionFactory configuration parsing, SqlSession and Executor creation, mapper proxy creation, CRUD execution, mapped statements, first-level and second-level cache, and JDBC execution.
- Spring MVC Source Analysishistorical
Breakpoint call stack, servlet class relationships, DispatcherServlet loading, request dispatch, HandlerMapping, HandlerAdapter, handler invocation, and view rendering.
- Thread Safetyhistorical
Thread-safety issues caused by Spring MVC singleton beans, solutions, and a reference.
- Spring MVC Learning Resourceshistorical
Common Spring MVC interview questions with detailed answers - CSDN Blog.
- Netty 3.x Source Analysishistorical
1. Overview 2. Boss-array initialization 3. Worker-array initialization 4. Bind
- 2.20 Apollohistorical
What Apollo is, how to use it, and how its push-pull configuration update mechanism works.
- Feignhistorical
What Feign is, why it exists, and how its interface proxy, Ribbon, Eureka, and HTTP request construction work.
- Gatewayhistorical
What Spring Cloud Gateway is, its Route/Predicate/Filter concepts, and its asynchronous non-blocking thread model.
- Hystrixhistorical
1. What Hystrix is 2. Why Hystrix is needed 3. Usage 4. Features 5. Principles 6. References
- 2.25 Ribbonhistorical
What Ribbon is, why load balancing is needed, usage, working flow, and load-balancing strategies.
- ApplicationListenerhistorical
1. What ApplicationListener is 2. How to use the event-listener mechanism 3. References
- 2.32 Autowired Principlehistorical
Class inheritance diagram and principle analysis of Spring's AutowiredAnnotationBeanPostProcessor.
- Spring Transaction Source Analysishistorical
1. Enable transaction management. 2. TransactionManagementConfigurationSelector imports AutoProxyRegistrar and ProxyTransactionManagementConfiguration. 3. Study AutoProxyRegistrar. 4. Study ProxyTransactionManagementConfiguration and transaction interception.
- 2.34 Custom Startershistorical
Two questions behind a custom Spring Boot starter and a complete hello-spring-boot-starter example.
- 2.35 Usagehistorical
Create a project, configure pom.xml, and use Spring Boot caching with Application, TestController, and TestService.
- Spring Boot Jar Startup Principlehistorical
1. Experiment. 2. Structure of an executable Jar. 3. How the program entry point is found. 4. Jar packages that can start without the java -jar command. 5. Reference.
- MyBatis Auto-Configurationhistorical
How Spring Boot enables MyBatis auto-configuration and how AutoConfiguredMapperScannerRegistrar determines which package to scan for @Mapper interfaces.
- Spring MVC Auto-Configuration Principlehistorical
1. Auto-configuration classes pre-imported by spring-boot-starter-web. 2. How custom configuration takes effect. 3. Why @EnableWebMvc disables Spring Boot MVC auto-configuration. 4. Reference.
- Embedded Tomcat Auto-Configuration Principlehistorical
1. Enable ServletContainer auto-configuration. 2. Inject the Tomcat container factory. 3. How custom configuration takes effect. 4. How to modify Tomcat configuration. 5. Summary.
- 2.43 Thread Isolationhistorical
Why thread isolation is needed, isolation modes, and thread-pool versus semaphore isolation.
- 2.47 Common Spring Annotationshistorical
Common Spring annotations and Aware interfaces, including Configuration, ComponentScan, Bean, Scope, Lazy, Conditional, Import, Value, Autowired, Qualifier, Primary, and Profile.
- Spring Transaction Propagationhistorical
1. What transaction propagation is. 1.1. Propagation behaviors including REQUIRED, SUPPORTS, MANDATORY, REQUIRES_NEW, NOT_SUPPORTED, and NEVER. 1.2. Notes. 2. References.
- Spring Boot Cache Auto-Configuration Principlehistorical
How the cache manager and cache classes are generated, how cache proxy classes are generated, and the overall execution flow.
- Off-Heap Memoryhistorical
1. What off-heap memory is 2. NIO off-heap memory 3. Netty off-heap memory 4. References
- 2.53 Usagehistorical
Create a project, configure pom.xml, and use Spring transactions with DbConfig, TestService, and TestDao.
- Circular Dependencieshistorical
1. What a circular dependency is 2. What problems it causes 3. How to solve it 4. References
- 2.56 1. Create NioEventLoopGrouphistorical
NioEventLoopGroup class hierarchy, constructor chain, initialization of selector/select strategy/rejection policy, EventLoop count, executor, child EventLoops, and chooser.
- 2. Bootstrap Creationhistorical
1. Code to analyze 2. Create ServerBootstrap 3. Set ServerBootstrap properties 4. ReflectiveChannelFactory
- Pipeline Initializationhistorical
1. When pipeline is created 2. What pipeline looks like 3. Tail and Head
- 1. Create the Spring Containerhistorical
1. Code to analyze 2. Create ApplicationContext and trace the refresh process
- Spring Boot Startup Principlehistorical
1. Start Spring Boot. 2. Process of creating SpringApplication: determine web environment, load ApplicationContextInitializer and ApplicationListener instances, save the main configuration class, and run the application.
- 2. Call BeanFactoryPostProcessor's postProcess Methodhistorical
1. Code to study 2. Process BeanDefinitionRegistryPostProcessors 3. Process BeanFactoryPostProcessors
- Spring Boot Auto-Configuration Principlehistorical
1. Enable Spring Boot auto-configuration. 2. Inject AutoConfigurationImportSelector into the container and import auto-configuration classes from META-INF/spring.factories. 3. Summary. 4. Reference.
- Create the NioEventLoop Arrayhistorical
1. Code to analyze 2. Parameters passed to NioEventLoop 3. NioEventLoop is a single-threaded thread pool 4. Constructor
- 3. Allocate a Thread and Register the Selectorhistorical
1. Code to analyze 2. Propagate through the pipeline 3. Pass through ServerBootstrapAcceptor 4. Analyze channelRead
- 3. Register BeanPostProcessorhistorical
1. Code to study 2. Obtain BeanPostProcessors 3. Classify them 4-7. Register each group
- 4. Register Read Events with the Selectorhistorical
1. Code to analyze 2. Set a breakpoint and connect with nc 3. Propagate channelActive 4. Reach HeadContext 5. Read through AbstractUnsafe
- 4. Bind the Server Porthistorical
Call path, AbstractBootstrap, AbstractUnsafe, and AbstractNioChannel
- Spring IoC Source: Instantiating All Non-Lazy Singleton Beanshistorical
Source tracing of finishBeanFactoryInitialization and preInstantiateSingletons through getBean, singleton lookup and creation, BeanPostProcessors, bean instantiation, property population, initialization, proxy creation, and destruction registration.
- 2.79 1. Instantiate the Channelhistorical
Instantiate NioServerSocketChannel through reflection, configure it as non-blocking, and create channelId, Unsafe, and pipeline.
- Netty Bind Source: Actually Binding the Listening Porthistorical
1. Code to analyze. 1.1. How NioEventLoop executes the Runnable. 1.2. What the bind task executed by NioEventLoop does, including JDK NIO bind, channelActive propagation, and registering interest in accept events.
- Inbound Eventshistorical
1. Add handlers for the experiment 2. Start from the pipeline 3. Forward through AbstractChannelHandlerContext 4. Enter HeadContext 5-8. Traverse inbound handlers to TailContext
- 1. Inject AspectJAnnotationAutoProxyCreator into the Containerhistorical
Enable AOP, register AspectJAnnotationAutoProxyCreator, and trace when ImportBeanDefinitionRegistrar.registerBeanDefinitions is called
- 2.1 How the AnnotationAwareAspectJAutoProxyCreator Bean Instance Is Createdhistorical
Class hierarchy, call-stack analysis, BeanFactoryAware setBeanFactory, registration and initialization of AnnotationAwareAspectJAutoProxyCreator
- Spring AOP Source Analysis Summaryhistorical
Created on Monday, July 22, 2019. Source analysis of Spring AOP from @EnableAspectJAutoProxy through auto-proxy creation and target-method interceptor execution.
- 2. Initialize Channelhistorical
1. Code to analyze 2. Obtain the channel pipeline and add a ChannelInitializer
- Netty Source: NioEventLoop run Methodhistorical
Code analysis of the NioEventLoop run loop: select, selector rebuild, selected-key optimization, processSelectedKeys, and asynchronous task execution.
- Outbound Eventshistorical
1. Add handlers for the experiment 2. Start from the pipeline 3. Enter TailContext 4-7. Traverse outbound handlers back to HeadContext
- ByteBufAllocatorhistorical
ByteBufAllocator class hierarchy, AbstractByteBufAllocator, unpooled allocation, and pooled allocation
- 2.2 When Does AnnotationAwareAspectJAutoProxyCreator Take Effect?historical
Trace postProcessBeforeInstantiation and postProcessAfterInitialization while creating singleton Beans
- 2.91 3. Register the Channelhistorical
Select a NioEventLoop, create a ChannelPromise/Future, register the channel through Unsafe with the JDK NIO selector, and invoke handlerAdded/initChannel callbacks.
- Exception Eventshistorical
1. Prepare experiment data 2. Start debugging 3-7. Propagate the exception through handlers to TailContext
- Usagehistorical
Historical example of allocating, reading, writing, and releasing a pooled direct ByteBuf
- 2.3 How AnnotationAwareAspectJAutoProxyCreator Creates Proxy Objectshistorical
Trace to postProcessBeforeInstantiation, determine whether a proxy is needed, wrap the Bean with advisors, and create JDK/CGLIB proxies
- 2.4 How the Target Method Is Executedhistorical
Invoke Calc.div, enter the proxy intercept method, build the interceptor chain, and execute interceptors plus the target method
- PooledByteBufAllocatorhistorical
newDirectBuffer, PoolThreadLocalCache, PoolThreadCache, and PoolArena