1. Exceptionhistorical

    Java's exception hierarchy distinguishes Error from Exception, with checked and unchecked exceptions. These notes organize their meaning and handling.

  2. How to Handle Exceptions Elegantlyhistorical

    Exception-handling wrappers can obscure business logic. These notes compare template-method and interface approaches for separating business code from error handling.

  3. BloomFilterhistorical

    These notes begin with Guava BloomFilter usage and trace construction, writes, and lookups through hashing and bit-array operations.

  4. How Lombok Workshistorical

    Lombok generates code through annotation processing during javac compilation. These notes examine how that process works.

  5. Introductionhistorical

    JDBC embeds SQL in Java, while Hibernate's object mapping involves flexibility trade-offs. These notes introduce MyBatis through those issues.

  6. Spring Cloudhistorical

    Spring Cloud provides microservice components on top of Spring Boot. These notes organize gateways, discovery, configuration, monitoring, load balancing, and circuit breaking.

  7. Spring Boothistorical

    Spring Boot builds on Spring with auto-configuration for starting projects quickly. These notes connect usage with related auto-configuration topics.

  8. 2.7 Introductionhistorical

    Spring MVC uses DispatcherServlet as its entry point, with HandlerMapping, HandlerAdapter, and ViewResolver handling requests and views.

  9. RateLimiterhistorical

    Guava RateLimiter provides a rate-limiting utility based on the token-bucket approach. These notes begin with usage and continue into its implementation.

  10. Usagehistorical

    JDBC properties, MyBatis configuration, and mapper files demonstrate the basic integration of MyBatis into a project.

  11. 2.10 Spring Moduleshistorical

    Spring Framework consists of multiple modules, with its core layer providing container capabilities. These notes organize responsibilities by module.

  12. 2.12 Usagehistorical

    These notes start with dependencies and web.xml to demonstrate Spring MVC setup and how DispatcherServlet connects to framework configuration.

  13. MyBatis Source Analysishistorical

    MyBatis can add interceptors through dynamic proxies when creating core objects. These notes trace the plugin mechanism through its four main objects.

  14. Spring MVC Source Analysishistorical

    Controller breakpoints reveal the request call stack, which these notes follow through HttpServlet, FrameworkServlet, and DispatcherServlet.

  15. Thread Safetyhistorical

    Mutable instance fields in singleton Spring MVC objects can cause problems under concurrent updates. These notes examine thread-safety approaches through that case.

  16. Usagehistorical

    Server and client examples demonstrate basic Netty usage, including startup and request handling.

  17. Netty 3.x Source Analysishistorical

    Netty 3.x creates thread pools and initializes Boss and Worker components. These notes trace its networking implementation through thread organization.

  18. 2.20 Apollohistorical

    Apollo centrally manages configuration and stores changes in a database. These notes examine how clients obtain changes after publication.

  19. Eurekahistorical

    Eureka provides service registration and discovery through a client-server architecture. These notes examine how registrations are stored and maintained.

  20. Feignhistorical

    Feign invokes remote interfaces. These notes examine declarative calls through annotations, Ribbon, RestTemplate, and related components.

  21. Gatewayhistorical

    Spring Cloud Gateway processes requests through routes, predicates, and filters. These notes begin with Route composition and examine matching and forwarding.

  22. Hystrixhistorical

    Hystrix provides fault tolerance for microservice calls. These notes start with failure propagation and examine circuit breaking, fallback, and related mechanisms.

  23. 2.25 Ribbonhistorical

    Ribbon is a client-side load-balancing component. These notes introduce its need and examine selection and execution during service calls.

  24. 2.26 Sleuthhistorical

    Sleuth records traces for Spring Cloud calls and can work with Zipkin to display interactions between services.

  25. Zuulhistorical

    Zuul is a Spring Cloud gateway component. These notes cover routing, filtering, and traffic-based rollout of new features.

  26. 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.

  27. 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.

  28. Usagehistorical

    Examples such as HelloWorld demonstrate Spring AOP usage and the relationship between aspect configuration and target-method calls.

  29. Usagehistorical

    Examples such as AopConfig and Calc demonstrate Spring AOP configuration and how aspects work with target objects.

  30. 2.32 Autowired Principlehistorical

    Spring handles dependency injection during post-processor registration and bean creation. These notes trace @Autowired through AutowiredAnnotationBeanPostProcessor.

  31. Spring Transaction Source Analysishistorical

    @EnableTransactionManagement imports transaction-management components. These notes trace registration and execution of Spring transaction objects from that annotation.

  32. 2.34 Custom Startershistorical

    A custom starter begins with its dependencies and auto-configuration. These notes organize the steps for extending Spring Boot.

  33. 2.35 Usagehistorical

    Application and test-class examples demonstrate Spring Boot caching, including application configuration and cache calls.

  34. Spring Boot Jar Startup Principlehistorical

    Project configuration and main-class examples introduce how a Spring Boot application starts after being packaged as a Jar.

  35. MyBatis Auto-Configurationhistorical

    Spring Boot creates MyBatis-related objects through auto-configuration. These notes trace integration through configuration-class initialization callbacks.

  36. Spring MVC Auto-Configuration Principlehistorical

    Spring Boot configures Web MVC through WebMvcAutoConfiguration. These notes examine the objects and methods through its inner configuration class.

  37. 2.39 Usagehistorical

    Examples such as Application demonstrate basic Spring Boot usage, including configuration and startup.

  38. Embedded Tomcat Auto-Configuration Principlehistorical

    Spring Boot creates an embedded Servlet container according to dependencies on the classpath. These notes trace auto-configuration using Tomcat as an example.

  39. Learning Resourceshistorical

    This page collects Netty learning references for further study of framework usage and source-code analysis.

  40. Summaryhistorical

    This page connects Netty source-analysis topics on server startup, Channel registration, and port binding through their call relationships.

  41. 2.43 Thread Isolationhistorical

    Thread isolation separates calls into distinct thread resources to prevent failing calls from exhausting a service. These notes use Hystrix configuration and execution as examples.

  42. Bean Lifecyclehistorical

    A Spring bean is instantiated and then undergoes property injection and further processing. These notes organize its lifecycle stages and extension points.

  43. 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.

  44. 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.

  45. 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.

  46. 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.

  47. Spring Boot Cache Auto-Configuration Principlehistorical

    Spring Boot creates cache-management objects through cache auto-configuration. These notes trace configuration selection and object creation from CacheAutoConfiguration.

  48. Component Introductionhistorical

    Netty is an asynchronous event-driven networking framework built around Java I/O. These notes organize its main roles through components such as Bootstrap.

  49. Off-Heap Memoryhistorical

    Off-heap memory lies outside the Java heap. These notes compare ByteBuffer allocation approaches and their relationship to data transfer.

  50. BeanFactoryhistorical

    BeanFactory instantiates, configures, and manages beans, while ApplicationContext adds further capabilities. These notes examine relationships among container interfaces.

  51. 2.53 Usagehistorical

    DbConfig and Service examples demonstrate Spring transaction usage and the relationship between data-source configuration and transactional methods.

  52. 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.

  53. 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.

  54. 2.56 1. Create NioEventLoopGrouphistorical

    NioEventLoopGroup manages multiple NioEventLoops and accepts Runnable tasks. These notes trace how the group is created through its constructors.

  55. 2. Bootstrap Creationhistorical

    After creating ServerBootstrap, Channel types, handlers, and options must be configured. These notes focus on how the Channel type is set.

  56. 3. Bind the Porthistorical

    These notes follow bind calls to examine how Netty port-binding requests reach the concrete Channel implementation.

  57. 1. Detect a New Connectionhistorical

    When a connection arrives, NioEventLoop handles an OP_ACCEPT event. These notes trace connection detection with breakpoints and a client connection.

  58. Pipeline Initializationhistorical

    Each Netty Channel has its own pipeline, created during AbstractChannel construction. These notes examine pipeline initialization.

  59. 1. Creating the Serverhistorical

    Starting from the server bind method, these notes follow the call chain to AbstractBootstrap.doBind and examine server creation.

  60. 1. Create the Spring Containerhistorical

    Creating a Spring container triggers refresh. These notes trace container initialization and bean retrieval from ApplicationContext creation.

  61. Spring Boot Startup Principlehistorical

    These notes start with a Spring Boot application's startup statement and trace the startup process while omitting simple nested calls.

  62. Create Executorhistorical

    These notes trace Netty Executor creation, starting with the thread factory and executor initialization.

  63. 2. Create NioSocketChannelhistorical

    Netty wraps accepted Java NIO connections in NioSocketChannel. These notes trace construction of that object and its parent classes.

  64. Adding and Removing ChannelHandlershistorical

    These notes begin with methods such as DefaultChannelPipeline.addLast and trace ChannelHandler insertion, validation, and removal.

  65. 2. Server Initializationhistorical

    These notes follow bind and doBind calls to trace the work performed during Netty server initialization.

  66. 2. Call BeanFactoryPostProcessor's postProcess Methodhistorical

    Spring invokes BeanFactoryPostProcessors during container refresh. These notes trace their execution from invokeBeanFactoryPostProcessors.

  67. Spring Boot Auto-Configuration Principlehistorical

    @SpringBootApplication connects annotations such as @EnableAutoConfiguration. These notes trace how Spring Boot auto-configuration takes effect from those entry points.

  68. Create the NioEventLoop Arrayhistorical

    NioEventLoopGroup creates individual NioEventLoops through newChild. These notes follow that call to examine event-loop-array initialization.

  69. 3. Allocate a Thread and Register the Selectorhistorical

    After a new connection passes through the pipeline, it needs a processing thread and Selector registration. These notes trace the related calls from connection acceptance.

  70. 3. Register the Selectorhistorical

    Starting from the server's bind call, these notes trace how a Channel is assigned an event loop and registered with the Selector.

  71. 3. Register BeanPostProcessorhistorical

    Spring registers bean post-processors through registerBeanPostProcessors. These notes follow the delegated calls that perform registration.

  72. 4. Register Read Events with the Selectorhistorical

    After Channel registration, read events must be registered with the Selector. These notes trace the process through AbstractChannel's register operation.

  73. 4. Bind the Server Porthistorical

    These notes trace the server bind call chain to examine how Netty binds a listening port to the underlying network channel.

  74. Spring IoC Source: Instantiating All Non-Lazy Singleton Beanshistorical

    FinishBeanFactoryInitialization instantiates non-lazy singleton beans. These notes focus on the execution of preInstantiateSingletons.

  75. Server Startuphistorical

    This page organizes Netty server-startup analysis into creation, initialization, Selector registration, and port binding.

  76. UML Diagramhistorical

    UML diagrams organize relationships among Spring IOC classes as a structural reference for reading container source code.

  77. 2.79 1. Instantiate the Channelhistorical

    Netty invokes the NioServerSocketChannel constructor through reflection and creates the underlying Java NIO channel. These notes trace that instantiation.

  78. Netty Bind Source: Actually Binding the Listening Porthistorical

    Netty wraps port binding as a task for the Channel's NioEventLoop. These notes trace the calls after task submission.

  79. Inbound Eventshistorical

    Experiments with multiple InboundHandlers show how Netty inbound events propagate through the pipeline.

  80. ByteBufhistorical

    ByteBuf uses reader and writer indexes to divide consumed, readable, and writable regions. These notes examine read and write API behavior through those indexes.

  81. 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.

  82. 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.

  83. 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.

  84. 2. Initialize Channelhistorical

    Channel initialization adds a ChannelInitializer to the pipeline and connects the handlers configured in ServerBootstrap.

  85. Netty Source: NioEventLoop run Methodhistorical

    NioEventLoop's run method repeatedly processes I/O events and tasks. These notes separate the main parts of the loop and trace execution.

  86. Outbound Eventshistorical

    Code examples with multiple OutboundHandlers show how Netty outbound events propagate through the pipeline.

  87. ByteBufAllocatorhistorical

    ByteBufAllocator allocates ByteBuf instances. These notes follow the abstract buffer method to examine choices such as heap and direct memory.

  88. 2.2 When Does AnnotationAwareAspectJAutoProxyCreator Take Effect?historical

    Breakpoints around bean initialization show when AnnotationAwareAspectJAutoProxyCreator participates in the bean lifecycle.

  89. 2.91 3. Register the Channelhistorical

    A server Channel uses EventLoopGroup to choose an event loop and register itself. These notes trace the process through ServerBootstrap calls.

  90. Exception Eventshistorical

    Server and Handler examples generate exceptions to examine how Netty propagates and handles exception events in the pipeline.

  91. Usagehistorical

    Code examples record Netty memory-related usage and provide a practical starting point for reading allocator implementations.

  92. 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.

  93. Channel Class Hierarchyhistorical

    Channel abstracts network I/O in Netty. These notes examine skeletal implementations and relationships among channel types through the class hierarchy.

  94. 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.

  95. PooledByteBufAllocatorhistorical

    PooledByteBufAllocator obtains a thread cache and its PoolArena, then allocates memory through the arena. These notes trace both stages.

  96. PoolThreadCachehistorical

    PoolThreadCache creates caches for memory regions of different sizes. These notes examine initialization of tiny, small, and normal MemoryRegionCache instances.

  97. 3.1 Comparison of the Three I/O Modelshistorical

    BIO, NIO, and AIO differ in blocking behavior, thread organization, and completion reporting. These notes compare them through server connections and request handling.

  98. 3.2 Multithreaded Server Implemented with BIOhistorical

    Multithreaded Server Implemented with BIO: Traditionally, server-side programming uses BIO.

  99. AIOhistorical

    Java AIO uses asynchronous file and socket channels. These notes examine asynchronous read and write organization through the related classes and examples.

  100. 3.4 BIOhistorical

    BIO reads and writes through input and output streams organized as bytes or characters. These notes introduce blocking I/O through those concepts.

  101. Bufferhistorical

    Buffer usage commonly follows writing, flip, reading, and clear or compact. These notes use its internal properties to explain state changes.

  102. 3.6 Server Implemented with NIOhistorical

    NIO server examples cover read and write events and connection closure, including how read return values indicate connection state.

  103. AIO Serverhistorical

    Server and client examples demonstrate Java asynchronous-I/O server programming and how connections and reads and writes complete.

  104. Basic Streamshistorical

    InputStream.read reads bytes and returns -1 at the end of the stream. These notes examine basic stream behavior through single-byte and bulk reads.

  105. Channelhistorical

    Data can both be read from a channel and written to a channel, while stream reading and writing are usually one-way.

  106. 3.10 Serialization Protocolhistorical

    Serialization converts objects or data structures into bytes for storage or transmission. These notes use examples such as ByteBuffer to examine protocol organization.

  107. File Streamshistorical

    Files can be read and written through byte or character streams. Examples with FileOutputStream, FileWriter, and related APIs cover writing, reading, and metadata access.

  108. Fileshistorical

    Files provides operations for existence checks, directory creation, copying, moving, deletion, and recursive traversal. These notes record them through code examples.

  109. Heartbeat Mechanismhistorical

    Heartbeats help servers clear idle channels and clients detect disconnections and decide whether to reconnect. These notes record both sides' handling.

  110. BIO Serverhistorical

    Server and client examples demonstrate BIO programming and the organization of blocking connections, reads, and writes.

  111. 3.15 NIOhistorical

    NIO organizes reads and writes around channels and buffers rather than BIO byte and character streams. These notes introduce usage through those components.

  112. Packet Protocolhistorical

    Application protocols must distinguish message boundaries in TCP data. These notes examine packet-protocol design through data examples and sticky-packet behavior.

  113. Pathhistorical

    Path represents a file-system path, with capabilities related to File. These notes use examples to record path creation and manipulation.

  114. NIO Serverhistorical

    Client and server code demonstrate Java NIO programming and how Channel, Buffer, and Selector cooperate on connections and data.

  115. enumhistorical

    Enum defines a set of named values implemented through Enum-related structures after compilation. These notes examine enumeration behavior through code.

  116. switchhistorical

    Switch selects a branch from an expression's value. These notes compare compiled implementations for integers, strings, and enums.

  117. transienthistorical

    Fields marked transient are excluded from default serialization and receive initial values after deserialization. These notes examine that behavior through examples.

  118. finalhistorical

    Final has different meanings on classes, methods, and variables. These notes record inheritance, overriding, and assignment restrictions.

  119. Cloneable and Object.clonehistorical

    Cloneable and Object.clone: It is a marker interface. An object that implements this interface can call Object.clone to copy the current object. What is copied here is the object's fields.

  120. 5.2 Integerhistorical

    Integer is immutable. These notes examine its structure and wrapper-type behavior through implementation details such as its final class.

  121. 5.3 ArrayListhistorical

    ArrayList is a resizable array-backed list that preserves order and allows duplicates. These notes trace its implementation through class relationships and the backing array.

  122. 5.4 Hashtablehistorical

    Hashtable provides thread-safe key-value storage, implements Map, and supports cloning and serialization. These notes examine operations through class relationships.

  123. Objecthistorical

    Object provides basic methods such as getClass, hashCode, and equals. These notes connect them with runtime types and hash-container usage.

  124. PriorityQueuehistorical

    PriorityQueue orders elements by priority rather than insertion order alone. These notes examine ordering rules and internal operations through examples.

  125. 5.7 Serializablehistorical

    Serialization stores or transmits memory objects, while deserialization restores them. These notes examine Serializable and its read and write methods.

  126. 5.8 HashSethistorical

    HashSet uses HashMap to store distinct elements. These notes examine set operations and source code through its structure.

  127. Stringhistorical

    String represents immutable strings that can be shared across threads. These notes examine the implementation of immutability and related operations.

  128. 5.10 LinkedListhistorical

    LinkedList is a doubly linked list that preserves order, allows duplicates, and supports deque operations. These notes examine its structure and operations.

  129. LinkedHashMaphistorical

    LinkedHashMap uses a doubly linked list to maintain order on top of HashMap. These notes compare their structures and trace operations.

  130. Immutable Objecthistorical

    Immutable objects do not change state after construction. These notes examine constraints such as final classes and fields when constructing them.

  131. LinkedHashSethistorical

    LinkedHashSet organizes data with LinkedHashMap and uses a placeholder value. These notes examine how that relationship supports set operations.

  132. StringBufferhistorical

    StringBuffer provides thread-safe mutable-string operations through synchronization. These notes compare it with StringBuilder.

  133. Converting Between List and Arrayhistorical

    Arrays and lists often need conversion. These notes use code examples to record conversions in both directions and their behavioral differences.

  134. Java Map Implementations Comparedhistorical

    HashMap implementations differ between JDK 1.7 and 1.8. These notes compare collision handling, tree conversion, and concurrent resizing.

  135. Collections.synchronizedSethistorical

    SynchronizedSet wraps set operations with synchronized protection. These notes connect its wrapper with the implementations of synchronized collections.

  136. StringBuilderhistorical

    StringBuilder stores characters in a resizable array and supports mutation without thread-safety guarantees. These notes trace append and resize operations.

  137. List Comparisonhistorical

    ArrayList and LinkedList use different underlying structures. A comparison table examines access, insertion, deletion, and related operations.

  138. Collections.synchronizedMaphistorical

    SynchronizedMap wraps map operations in synchronization blocks. These notes connect it with SynchronizedList to examine synchronized wrappers.

  139. TreeSethistorical

    TreeSet uses TreeMap to store distinct elements. These notes examine insertion, lookup, and iteration through the underlying method calls.

  140. String Comparisonhistorical

    String is immutable, while StringBuilder and StringBuffer are mutable. A comparison table examines thread safety and usage scenarios.

  141. Collections.synchronizedListhistorical

    SynchronizedList adds synchronization around list operations. These notes cover its wrapper and source code through the need for thread safety.

  142. 5.24 TreeMaphistorical

    TreeMap stores key-value pairs in a red-black tree with O(log N) basic operations. These notes examine key ordering and iteration.

  143. 5.25 Vectorhistorical

    Vector is a thread-safe list with indexed access, cloning, and serialization. These notes examine usage and implementation through its class relationships.

  144. 5.26 fail-fasthistorical

    Fail-fast stops immediately on an error, while fail-safe allows continued operation in some cases. These notes connect that distinction with collection iteration.

  145. HashMap in JDK 7historical

    JDK 1.7 HashMap derives bucket indexes from hashes and array length, then handles collisions with linked lists. These notes trace the related methods.

  146. HashMap in JDK 8historical

    JDK 1.8 HashMap organizes key-value data with arrays, linked lists, and red-black trees. These notes trace its implementation through access behavior and class relationships.

  147. 6.1 Start with the Hardwarehistorical

    Understanding the Java Memory Model starts with CPU, memory, and cache relationships. These notes introduce the hardware issues through the von Neumann architecture.

  148. 6.2 2.Synchronizedhistorical

    Synchronized protects Java synchronization blocks. These notes examine usage and implementation through atomicity, ordering, visibility, and locking overhead.

  149. 6.3 3.volatilehistorical

    These volatile notes examine ordering, visibility, and atomicity, compare volatile with synchronized, and record usage scenarios.

  150. 6.4 CAShistorical

    CAS can be introduced through the distinction between optimistic and pessimistic locking. These notes compare conflict handling before examining compare-and-swap.

  151. 6.5 5.AQShistorical

    AQS is a queued synchronizer for building JUC concurrency utilities. These notes examine when and how to use it for custom synchronization tools.

  152. 6.6 6.ReentrantLockhistorical

    ReentrantLock provides explicit locking and unlocking. These notes compare it with synchronized and trace its implementation through AQS-related classes.

  153. 6.7 7.Lock Conditionhistorical

    Condition works with Lock for condition waiting and notification. These notes compare it with Object.wait and notify through producer-consumer scenarios.

  154. 6.8 8.CyclicBarrierhistorical

    CyclicBarrier makes threads wait for one another before proceeding and can be reused. These notes trace its implementation through Lock and Condition.

  155. 6.9 9.CountDownLatchhistorical

    CountDownLatch lets threads wait for tasks to complete and resumes them when the counter reaches zero. These notes trace its one-shot behavior through AQS.

  156. 6.10 10.CopyOnWriteArrayListhistorical

    CopyOnWriteArrayList separates reads from writes, allowing unlocked reads while copying data on writes. These notes examine the mechanism and its consistency behavior.

  157. 6.11 11.CopyOnWriteArraySethistorical

    CopyOnWriteArraySet stores distinct elements using CopyOnWriteArrayList. These notes trace its copy-on-write implementation through methods such as addIfAbsent.

  158. 6.12 ArrayBlockingQueuehistorical

    ArrayBlockingQueue is a bounded blocking queue backed by an object array. These notes trace waiting and notification through its shared lock.

  159. 6.13 13.ThreadLocalhistorical

    ThreadLocal stores independent data for each thread rather than sharing one variable's state. These notes examine its internal map through data isolation.

  160. 6.14 14.ThreadPoolhistorical

    Thread pools separate submission from execution and reuse threads to reduce creation and destruction. These notes examine Java pool structure and execution.

  161. 6.15 CompletableFuturehistorical

    CompletableFuture organizes asynchronous computation by running work on separate threads and continuing processing when results become available.

  162. 6.16 ConcurrentHashMap in JDK 1.7historical

    JDK 1.7 ConcurrentHashMap uses segmented locking with arrays and linked lists for concurrent updates. These notes trace the implementation through Segment and HashEntry.

  163. 6.17 fork_joinhistorical

    Fork/Join splits large work into parallel subtasks and combines their results. These notes introduce the framework through limitations of ordinary thread pools.

  164. 6.18 Exchangerhistorical

    Exchanger: Used to exchange data between two threads. The data flow is bidirectional. That is, if there are two threads, Thread1 and Thread2, Thread1 sends one piece of data to Thread2, while Thread2 also sends one piece of data to Thread1.

  165. 6.19 ReentrantReadWriteLockhistorical

    Exclusive locks prevent concurrent readers, while read-write locks allow them. These notes introduce ReentrantReadWriteLock through that need.

  166. 6.20 Semaphorehistorical

    Semaphore limits concurrent resource access through permits. These notes examine fair and nonfair policies and permit acquisition and release.

  167. 6.21 Kernel-Level Threadhistorical

    User-level threads are managed by applications, while kernel threads are visible to and scheduled by the operating system. These notes connect the distinction with Java threads.

  168. 6.22 Unsafehistorical

    Unsafe exposes low-level operations such as direct memory access. These notes introduce them through C pointers and memory allocation and examine why care is required.

  169. 6.23 Revisiting the JMMhistorical

    Processor architectures impose different constraints on memory operations. These notes examine how JMM abstracts those differences through observable execution order.

  170. 6.24 Lock Optimizationhistorical

    Java has introduced several synchronized optimizations. These notes begin with lock elimination and examine how compilers and runtimes reduce synchronization costs.

  171. 6.25 Implementing a Simple AQS by Handhistorical

    Writing a simplified AQS illustrates how an exclusive lock records its owner and how other threads wait and resume.

  172. 6.26 Fair Lockhistorical

    A fair lock follows the first-come, first-served principle.

  173. 6.27 BlockingQueuehistorical

    BlockingQueue provides a thread-safe blocking-queue interface. These notes examine enqueue and dequeue operations, waiting, timeouts, and failure behaviors.

  174. 6.28 Executorshistorical

    Executors provides factory methods for different thread pools. These notes compare cached, fixed-size, single-threaded, and scheduled pools through examples.

  175. 6.29 ConcurrentHashMap in JDK 1.8historical

    JDK 1.8 ConcurrentHashMap combines synchronized, CAS, arrays, linked lists, and red-black trees for thread-safe access. These notes trace execution through methods such as putVal.

  176. 6.30 Producer-Consumerhistorical

    Producers and consumers wait when conditions are unmet and wake one another when work can proceed. These notes compare wait/notify and two-Condition approaches.

  177. 6.31 Nonfair ReadWriteLockhistorical

    These notes follow ReentrantReadWriteLock source code to examine nonfair read-write lock acquisition and direct acquisition attempts.

  178. 6.32 Nonfair Semaphorehistorical

    A nonfair semaphore allows direct competition for permits. These notes trace acquisition and waiting through NonfairSync.

  179. 6.33 Thread.sleephistorical

    After Thread.sleep ends, a thread can compete for the CPU again but is not guaranteed immediate execution. These notes illustrate that distinction with a timing example.

  180. 6.34 Nonfair Lockhistorical

    A nonfair lock allows threads to attempt acquisition when the lock becomes free without requiring arrival order. These notes trace NonfairSync.lock.

  181. 6.35 LinkedBlockingQueuehistorical

    LinkedBlockingQueue uses a singly linked list with separately coordinated reads and writes. These notes trace waiting and notification through its node structure.

  182. 6.36 RejectedExecutionHandlerhistorical

    When a thread pool's workers and queue are full, a rejection handler processes new tasks. These notes examine RejectedExecutionHandler implementations.

  183. 6.37 Deadlockhistorical

    Java examples create a deadlock and inspect thread states to show how mutual waiting prevents progress.

  184. 6.38 Fair ReadWriteLockhistorical

    These notes follow ReentrantReadWriteLock source code to examine fair read-write locking and how the wait queue participates in acquisition.

  185. 6.39 Fair Semaphorehistorical

    A fair semaphore allocates permits under a fairness policy. These notes trace permit acquisition and queuing through FairSync.

  186. 6.40 Thread Stateshistorical

    Java threads transition between execution states. These notes use the thread-state enumeration and a state diagram to organize those relationships.

  187. 6.41 PriorityBlockingQueuehistorical

    PriorityBlockingQueue uses a binary heap for a priority-ordered blocking queue. These notes examine its array representation, ordering, and waiting on an empty queue.

  188. 6.42 SynchronousQueuehistorical

    SynchronousQueue stores no elements, so writes must pair with reads or wait. These notes trace the process through its transfer structures.

  189. 6.43 Atomichistorical

    Atomic classes provide thread-safe atomic operations through mechanisms such as CAS. These notes trace implementation using AtomicInteger.

  190. Java Production Issue Troubleshootinghistorical

    Java production troubleshooting can start by finding resource-heavy processes with tools such as top, then locating related threads or code. These notes record diagnostic steps.

  191. Garbage Collection Conceptshistorical

    Object reclamation can use approaches such as reference counting or reachability. These notes begin with counters and examine circular-reference problems.

  192. 7.4 Class Lifecyclehistorical

    Java classes pass through loading, linking, initialization, use, and unloading. These notes organize the work performed at each stage.

  193. 7.5 Memory Regionshistorical

    The JVM uses runtime memory areas for objects and other data. These notes begin with the heap and examine each area's role and creation timing.

  194. 7.6 Tuning Approachhistorical

    Tuning Approach: Reduce the number of Full GCs / reduce Full GC duration / reduce memory usage.

  195. Garbage Collection Algorithmshistorical

    Garbage collection identifies reachable objects and handles those no longer used. These notes organize algorithms around marking and reclamation.

  196. Class Initialization Orderhistorical

    Active use can trigger Java class initialization, including prior parent-class initialization. These notes use code examples to examine class and instance initialization order.

  197. 7.9 Object Allocation Ruleshistorical

    Object Allocation Rules: Objects are preferentially allocated in the Eden area. If there is not enough space in Eden, the virtual machine performs a Minor GC.

  198. 7.10 3. Garbage Collectorshistorical

    Objects have different lifetimes, motivating generational memory organization and collection. These notes compare collectors through young- and old-generation characteristics.

  199. Custom Class Loaderhistorical

    Custom class loaders can load classes from selected paths and isolate same-named classes in different applications. These notes examine implementations through those scenarios.

  200. Escape Analysishistorical

    Escape analysis examines an object's scope and whether code outside a method or thread can access it. These notes organize cases such as method escape.

  201. 7.13 4. Selecting a Specific Garbage Collector with JVM Parametershistorical

    JVM startup options select garbage collectors. These notes record collector combinations for young and old generations and their corresponding flags.

  202. 7.14 Object Creation Processhistorical

    Java object creation involves allocation, constructor invocation, and storing a reference. These notes trace a new expression through bytecode.

  203. Garbage Collectionhistorical

    JVM garbage collection can be studied through its concepts, algorithms, collectors, and selection flags. This page links those topics.

  204. 7.16 Object Layout in Memoryhistorical

    Java objects store headers and instance data, with arrays also carrying length information. These notes compare ordinary-object and array layouts.

  205. 7.17 Referenceshistorical

    Java references have different strengths that affect whether an object can be reclaimed. These notes compare them through examples, starting with strong references.

  206. How Objects Are Locatedhistorical

    Java can locate objects through direct pointers. These notes compare object-access approaches and examine references when garbage collection moves objects.

  207. 7.19 OOM Exampleshistorical

    GC cannot reclaim strongly reachable objects, which may continue consuming memory. These notes illustrate out-of-memory failures across memory areas.

  208. 7.20 Performance Analysis Toolshistorical

    JVM performance troubleshooting begins with process information and suitable diagnostic tools. These notes organize tools by their commands and output.

  209. 7.21 JVM Parameter Tuninghistorical

    JVM heap size can be configured with options such as -Xms and -Xmx. These notes continue with generation ratios and their relationship to GC costs.

  210. 7.22 GC Log Analysishistorical

    GC logs expose young- and old-generation collections. These notes use Parallel GC logs to explain output fields and analysis tools.

  211. OOPhistorical

    Inheritance affects constructors, fields, and methods in Java. These notes examine those relationships through parent-child class examples.

  212. 9. Reflectionhistorical

    Reflection retrieves information such as class fields and methods at runtime. These notes use examples to examine dynamic inspection and object operations.

  213. 10. Sockethistorical

    Socket programming involves connections and I/O. These notes compare ServerSocket, Socket, and NIO channels to examine server-client relationships.

  214. Servlethistorical

    A Servlet calls init after creation and service for requests, dispatching to methods such as doGet and doPost. These notes organize the lifecycle.

  215. 11.2 Tuninghistorical

    Tomcat tuning can start with JVM options in startup scripts and continue with connector settings. These notes record configuration methods and inspection commands.

  216. 11.3 Usagehistorical

    Examples such as HelloServlet demonstrate Servlet usage and how requests enter the application handler.

  217. 11.4 Connectorhistorical

    Tomcat Connector accepts network requests and passes them to the adapter and container. These notes examine its structure through Boss/Worker responsibilities.

  218. Tomcat Startup Flowhistorical

    Tomcat's startup.bat calls catalina.bat. These notes follow the scripts into the main class and trace container startup.

  219. Tomcat Request Processing: Source Viewhistorical

    Tomcat startup includes init and start stages. These notes trace request-handling source code through the distinction between binding a port and accepting connections.

  220. Building Tomcat from Sourcehistorical

    These notes record Maven configuration for Tomcat source and startup and debugging through the Bootstrap class.

  221. 11.8 Containerhistorical

    A Tomcat Server can contain multiple Services, each combining Connectors and a Container. These notes organize the architecture by those levels.

  222. 11.9 Configuration-File Levelhistorical

    Using a local Tomcat URL, these notes examine how configuration maps a request to its application and handling path.

  223. 11.10 LifeCyclehistorical

    This note records Tomcat LifeCycle structures in diagrams as a reference for reading container-lifecycle source code.

  224. 11.11 Architecturehistorical

    Tomcat serves as both an HTTP server and a Servlet container, handing requests to application classes. These notes examine its architecture through that division.

  225. Genericshistorical

    Generics parameterize types so the same logic can serve multiple data types. These notes compare them with overloading and Object parameters through sorting requirements.

  226. Java 8 New Featureshistorical

    Java 8 introduced features such as lambda expressions and the Stream API. These notes organize syntax and examples by feature.

  227. Comparehistorical

    Comparator defines comparison rules. These notes use a custom compare method to show how its return value determines element order.

  228. Estimating Thread Pool Sizehistorical

    Thread counts can be estimated from QPS and response time, then checked with load testing. These notes record that estimation and validation process.

  229. Multithreaded Folder Size Statisticshistorical

    Directory-size calculation is split across threads and their results combined, illustrating how to organize parallel tasks.