All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nikedlab.android.inject.ApplicationSingleton Maven / Gradle / Ivy

There is a newer version: 3.0.13
Show newest version
package com.nikedlab.android.inject;

public class ApplicationSingleton {

   private static final ApplicationSingleton INSTANCE = new ApplicationSingleton();
   
   private ApplicationContext applicationContext;
   private Injector injector;

   private ApplicationSingleton() {
   }
   
   public synchronized ApplicationContext getApplicationContext() {
      if (applicationContext == null) {
         applicationContext = new DirectApplicationContext();
      }
      return applicationContext;
    }
    
   public synchronized Injector getInjector() {
      if (injector == null) {
         ApplicationContext applicationContext = getApplicationContext();
         injector = new Injector(applicationContext);
      }
      return injector;
    }
   
   public static ApplicationSingleton getInstance() {
     return INSTANCE;
   }
   
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy