Shepherd Advanced Notes
Author

Shepherd Advanced Notes

Dedicated to sharing advanced Java technical insights, daily work snippets, and the power of persistent effort.

122
Articles
0
Likes
0
Views
0
Comments
Recent Articles

Latest from Shepherd Advanced Notes

100 recent articles max
Shepherd Advanced Notes
Shepherd Advanced Notes
Jan 13, 2025 · Backend Development

Practical Issues and Solutions for Spring Boot Scheduled Tasks, Plus Implementation Details

The article examines common pitfalls of Spring Boot scheduled tasks—such as missing logs, single‑threaded execution, and distributed conflicts—offers trace‑ID logging via AOP, discusses async handling, outlines multi‑threading and distributed scheduling options, and explains the inner workings of @Scheduled and cron expressions.

AOPCron ExpressionDistributed Scheduling
0 likes · 16 min read
Practical Issues and Solutions for Spring Boot Scheduled Tasks, Plus Implementation Details
Shepherd Advanced Notes
Shepherd Advanced Notes
Dec 17, 2024 · Backend Development

Spring Boot Scheduling: Timer vs ScheduledExecutorService vs @Scheduled

This article compares three single‑node scheduling approaches in Spring Boot—Java's legacy Timer, the modern ScheduledExecutorService, and Spring's @Scheduled annotation—showing their implementations, execution characteristics, thread handling, error behavior, and when to prefer each solution.

@ScheduledJava concurrencyScheduledExecutorService
0 likes · 19 min read
Spring Boot Scheduling: Timer vs ScheduledExecutorService vs @Scheduled
Shepherd Advanced Notes
Shepherd Advanced Notes
Nov 18, 2024 · Fundamentals

Why Java’s Ternary Operator Can Throw NPE: Autoboxing Pitfalls Explained

The article explains how Java’s ternary operator can cause NullPointerException when type inference leads to automatic unboxing of a null wrapper, demonstrates this with concrete code examples, decompiled bytecode, and offers strategies such as using consistent types or replacing the ternary with if‑else.

JavaNullPointerExceptionautoboxing
0 likes · 11 min read
Why Java’s Ternary Operator Can Throw NPE: Autoboxing Pitfalls Explained
Shepherd Advanced Notes
Shepherd Advanced Notes
Oct 31, 2024 · Backend Development

How to Run Custom Code at Spring Boot Startup: 8 Implementation Options

This article explains eight ways to execute custom initialization logic during Spring Boot startup, covering CommandLineRunner, ApplicationRunner, ApplicationListener, @EventListener, @PostConstruct, BeanPostProcessor, InitializingBean, SmartInitializingSingleton, and the main method, with code examples and suitable use‑case guidance.

BeanPostProcessorCommandLineRunnerPostConstruct
0 likes · 10 min read
How to Run Custom Code at Spring Boot Startup: 8 Implementation Options
Shepherd Advanced Notes
Shepherd Advanced Notes
Oct 24, 2024 · Backend Development

What Exactly Happens During Spring Boot Startup? A Deep Dive

This article walks through the Spring Boot startup sequence, detailing how the @SpringBootApplication entry point creates a SpringApplication instance, prepares the environment, builds and refreshes the IoC container, runs ApplicationRunner/CommandLineRunner callbacks, and finally publishes the ApplicationReadyEvent.

ApplicationContextConfigurationIOC Container
0 likes · 10 min read
What Exactly Happens During Spring Boot Startup? A Deep Dive
Shepherd Advanced Notes
Shepherd Advanced Notes
Oct 10, 2024 · Backend Development

Master ApplicationRunner and CommandLineRunner: Usage and Implementation in Spring Boot

This article explains the purpose of Spring Boot's ApplicationRunner and CommandLineRunner interfaces, demonstrates common startup tasks such as data initialization, configuration loading, cache population and license verification, compares their parameter handling, shows how to control execution order with @Order, and reveals the internal call chain that Spring uses to invoke these runners.

ApplicationRunnerCommandLineRunnerInitialization
0 likes · 15 min read
Master ApplicationRunner and CommandLineRunner: Usage and Implementation in Spring Boot
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 30, 2024 · Backend Development

Deep Dive into Xxl-Job Core Architecture: How It Works and Why

This article explains Xxl-Job’s lightweight distributed scheduling architecture, covering the admin console, executor startup, JobHandler initialization, HTTP server registration, task triggering logic with scheduling threads, fast/slow thread pools, routing and blocking strategies, and result callbacks, illustrated with code snippets and diagrams.

Distributed SchedulingJavaSpring Boot
0 likes · 21 min read
Deep Dive into Xxl-Job Core Architecture: How It Works and Why