Package com.onec.ui
Class UpdateChecker
java.lang.Object
com.onec.ui.UpdateChecker
Periodically asks onec-cloud for the latest published framework version and, when it is newer than
the running one, flips
status() to "update available" — which the web client reads off
/api/config and renders as a dismissible banner.
Deliberately self-contained: a daemon ScheduledExecutorService (the same pattern as
UiEventPublisher's keepalive, so the framework needs no @EnableScheduling) and the
JDK HttpClient (no new dependency). Every failure path — disabled, unknown local version,
network error, non-200, malformed body — is swallowed to a debug log and leaves the status at
"no update", so a flaky network never produces a wrong or alarming notice.
-
Constructor Summary
ConstructorsConstructorDescriptionUpdateChecker(UpdateProperties props, String currentVersion, com.fasterxml.jackson.databind.ObjectMapper mapper) -
Method Summary
-
Constructor Details
-
UpdateChecker
public UpdateChecker(UpdateProperties props, String currentVersion, com.fasterxml.jackson.databind.ObjectMapper mapper)
-
-
Method Details
-
start
@PostConstruct public void start()Schedules the recurring check. A no-op when disabled or the local version is unknown. -
status
The last-known result; never null. -
shutdown
@PreDestroy public void shutdown()
-