public class UpdateChecker extends Object implements Runnable, Lifecycle
UpdateCheckerReporter
.
The task will not run if the user has opted out of anonymous usage reporting. There are three ways to disable the anonymous usage reporting:
AXONIQ_UPDATE_CHECKER_DISABLED=true
.-Daxoniq.update-checker.disabled=true
.$HOME/.axoniq/update-checker.properties
with content disabled=true
disabled=false
in a method of higher precedence will ignore the lower precedence disabled.
This class is not intended to be in use during the running of test suites and therefore does not run when it detects one.
Lifecycle.LifecycleHandler, Lifecycle.LifecycleRegistry
Constructor and Description |
---|
UpdateChecker(UpdateCheckerHttpClient client,
UpdateCheckerReporter reporter)
Creates a new instance of
UpdateCheckTask with the given UpdateCheckerHttpClient . |
UpdateChecker(UpdateCheckerHttpClient client,
UpdateCheckerReporter reporter,
ScheduledExecutorService executor) |
Modifier and Type | Method and Description |
---|---|
boolean |
isStarted()
Checks if the UpdateChecker has been started.
|
void |
registerLifecycleHandlers(Lifecycle.LifecycleRegistry lifecycle)
Registers the activities to be executed in the various phases of an application's lifecycle.
|
void |
run() |
void |
start()
Starts the anonymous usage reporting task.
|
void |
stop()
Allows the task to be stopped, preventing any further updates from being checked.
|
public UpdateChecker(UpdateCheckerHttpClient client, UpdateCheckerReporter reporter)
UpdateCheckTask
with the given UpdateCheckerHttpClient
.client
- The HTTP client used to send requests to the telemetry endpoint.reporter
- The reporter that will handle the response from the telemetry endpoint.public UpdateChecker(UpdateCheckerHttpClient client, UpdateCheckerReporter reporter, ScheduledExecutorService executor)
public void registerLifecycleHandlers(@Nonnull Lifecycle.LifecycleRegistry lifecycle)
Lifecycle
registerLifecycleHandlers
in interface Lifecycle
lifecycle
- the lifecycle instance to register the handlers withLifecycle.LifecycleRegistry.onShutdown(int, Runnable)
,
LifecycleRegistry#onShutdown(int, LifecycleHandler)
,
Lifecycle.LifecycleRegistry.onStart(int, Runnable)
,
LifecycleRegistry#onStart(int, LifecycleHandler)
public void start()
public void stop()
public boolean isStarted()
true
if the UpdateChecker has been started, false
otherwise.Copyright © 2010–2025. All rights reserved.