Lifecycle Interface in Spring
Lifecycle Interface Overview
Spring containers possess inherent lifecycle states. To synchronize managed beans (e.g., database connections) with container events, implement the Lifecycle interface:
public interface Lifecycle {
void start();
void stop();
boolean isRunning();
}
start(): Initiates object lifecycle
stop(): Terminates ...
Đăng vào ngày 6 tháng 6 lúc 01:43