FeatureSdkCore - DataDog/dd-sdk-android GitHub Wiki

interface FeatureSdkCore : SdkCore

Extension of SdkCore containing the necessary methods for the features development.

SDK core is always guaranteed to implement this interface.

Inheritors

InternalSdkCore

Properties

internalLogger

abstract val internalLogger: InternalLogger

Logger for the internal SDK purposes.

Functions

createScheduledExecutorService

abstract fun createScheduledExecutorService(executorContext: String): ScheduledExecutorService

Returns a new ScheduledExecutorService, set up with internal monitoring. It will use a default of one thread and can spawn at most as many thread as there are CPU cores.

Parameters
executorContext Context to be used for logging and naming threads running on this executor.

createSingleThreadExecutorService

abstract fun createSingleThreadExecutorService(executorContext: String): ExecutorService

Returns a new single thread ExecutorService, set up with backpressure and internal monitoring.

Parameters
executorContext Context to be used for logging and naming threads running on this executor.

getFeature

abstract fun getFeature(featureName: String): FeatureScope?

Retrieves a registered feature.

Return

the registered feature with the given name, or null

Parameters
featureName the name of the feature to retrieve

getFeatureContext

abstract fun getFeatureContext(featureName: String): Map<String, Any?>

Retrieves the context for the particular feature.

Return

Context for the given feature or empty map if feature is not registered.

Parameters
featureName Feature name.

registerFeature

abstract fun registerFeature(feature: Feature)

Registers a feature to this instance of the Datadog SDK.

Parameters
feature the feature to be registered.

removeContextUpdateReceiver

abstract fun removeContextUpdateReceiver(featureName: String, listener: FeatureContextUpdateReceiver)

Removes context update listener for the given feature.

Parameters
featureName Feature name.
listener Listener to remove.

removeEventReceiver

abstract fun removeEventReceiver(featureName: String)

Removes events receive for the given feature.

Parameters
featureName Feature name.

setContextUpdateReceiver

abstract fun setContextUpdateReceiver(featureName: String, listener: FeatureContextUpdateReceiver)

Sets context update receiver for the given feature.

Parameters
featureName Feature name.
listener Listener to remove.

setEventReceiver

abstract fun setEventReceiver(featureName: String, receiver: FeatureEventReceiver)

Sets event receiver for the given feature.

Parameters
featureName Feature name.
receiver Event receiver.

updateFeatureContext

abstract fun updateFeatureContext(featureName: String, updateCallback: (context: MutableMap<String, Any?>) -> Unit)

Updates the context if exists with the new entries. If there is no context yet for the provided featureName, a new one will be created.

Parameters
featureName Feature name.
updateCallback Provides current feature context for the update. If there is no feature with the given name registered, callback won't be called.