Class AbstractJanitor
java.lang.Object
dev.tachyonmcp.core.server.internal.AbstractJanitor
- All Implemented Interfaces:
AutoCloseable
Shared periodic-sweep scheduling for background cleanup tasks (session eviction, task
expiry/retention). A single daemon thread runs
sweep() at a fixed delay; exceptions
from a sweep are caught and logged so one failed pass doesn't cancel future runs.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractJanitor(String threadName) Creates a janitor with the given thread name. -
Method Summary
-
Constructor Details
-
AbstractJanitor
Creates a janitor with the given thread name.- Parameters:
threadName- the daemon thread name
-
-
Method Details
-
start
Starts the periodic sweep at the given interval. Idempotent — later calls no-op.- Parameters:
interval- the sweep interval
-
sweep
protected abstract void sweep()One janitor pass. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-