-
- All Implemented Interfaces:
-
co.elastic.apm.android.sdk.features.persistence.scheduler.ExportScheduler,co.elastic.apm.android.sdk.internal.services.periodicwork.PeriodicTask
public final class DefaultExportScheduler implements PeriodicTask, ExportScheduler
Default export scheduler that executes periodically while the app is running.
-
-
Constructor Summary
Constructors Constructor Description DefaultExportScheduler(long minDelayBetweenExportsInMillis)Default export scheduler that executes periodically while the app is running.
-
Method Summary
Modifier and Type Method Description voidonPersistenceEnabled()This is called during the agent initialization when the persistence feature is enabled. voidonPersistenceDisabled()This is called during the agent initialization when the persistence feature is disabled.It might be used to cancel previously scheduled periodic work when the feature was enabled. booleanshouldRunTask()Indicates whether this task should run as part of the ongoing PeriodicWorkService iterationor not. voidrunTask()Runs only if shouldRunTask returs true. booleanisTaskFinished()Indicates whether this task needs to keep running in future iterations or not. -
-
Method Detail
-
onPersistenceEnabled
void onPersistenceEnabled()
This is called during the agent initialization when the persistence feature is enabled. Itshould be the place where any setup/initialization of the reading/exporting scheduling is done.
-
onPersistenceDisabled
void onPersistenceDisabled()
This is called during the agent initialization when the persistence feature is disabled.It might be used to cancel previously scheduled periodic work when the feature was enabled.
-
shouldRunTask
boolean shouldRunTask()
Indicates whether this task should run as part of the ongoing PeriodicWorkService iterationor not.
-
runTask
void runTask()
Runs only if shouldRunTask returs true.
-
isTaskFinished
boolean isTaskFinished()
Indicates whether this task needs to keep running in future iterations or not.
-
-
-
-