Package 

Class SdkServiceLocator

  • All Implemented Interfaces:
    com.appsflyer.internal.components.di.ServiceLocator

    
    public final class SdkServiceLocator
     implements ServiceLocator
                        

    Every cached dependency is held in a CachedDependency, so concurrent first calls to a getter always produce a single instance (DELIVERY-129908). Getters that cannot cache unconditionally - feature-guarded ones that return null and must retry, or ones that take a parameter - create under the same monitor instead; the frequently called ones read a volatile field first, so after creation no getter takes the monitor.

    Invariants, because every creation holds the locator's monitor:

    • An initializer must never wait for another thread that resolves a dependency from this locator.

    • Constructors must stay cheap: defer disk reads, class loading of DexGuard-encrypted classes and thread creation to first use (see DependencyProvider), or another thread's first call to an unrelated getter waits for them.