Acquire the Lookup registry.

@return The lookup registry.
425753
public static Lookup get() {
        if (LOOKUP != null) {
            return LOOKUP;
        }
        synchronized (Lookup.class) {
            // allow for override of the Lookup.class
            String overrideClassName = System.getProperty(Lookup.class.getName());
            ClassLoader l = Thread.currentThread().getContextClassLoader();
            try {
                if (overrideClassName != null && !"".equals(overrideClassName)) {
                    LOOKUP = (Lookup) Class.forName(overrideClassName, true, l).newInstance();
                } else {
                    LOOKUP = new Lookup();
                }
            } catch (Exception e) {
                // ignore
            }
            // ServiceLoader and CDI are used by defaults, important that
            // CDI is used first so that beans are enabled for injection
            CdiLookup cdiLookup = new CdiLookup();
            LOOKUP.lookupProviders.add(cdiLookup);
            ServiceLoaderLookup serviceLoaderLookup = new ServiceLoaderLookup();
            LOOKUP.lookupProviders.add(serviceLoaderLookup);
            // Use ServiceLoader to find other LookupProviders
            Collection<LookupProvider> providers = serviceLoaderLookup
                    .lookupAll(LookupProvider.class);
            LOOKUP.lookupProviders.addAll(providers);
        }

        return LOOKUP;
    }
409852
public synchronized Register[] getRegisters() {
        Register[] dest = new Register[registers.length];
        System.arraycopy(registers, 0, dest, 0, dest.length);
        return dest;
    }
49944
private DirectoryLookupService getLookupService(){
        if(lookupService == null){
            synchronized(this){
                if(lookupService == null){
                    boolean cacheEnabled = Configurations.getBoolean(SD_API_CACHE_ENABLED_PROPERTY,
                            SD_API_CACHE_ENABLED_DEFAULT);
                    if(cacheEnabled){
                        CachedDirectoryLookupService service = new CachedDirectoryLookupService(directoryServiceClientManager);
                        service.start();
                        lookupService = service;
                        LOGGER.info("Created the CachedDirectoryLookupService in LookupManager");
                    } else {
                        lookupService = new DirectoryLookupService(directoryServiceClientManager);
                        LOGGER.info("Created the DirectoryLookupService in LookupManager");
                    }
                }
            }
        }
        return lookupService;
    }
998024
private boolean fetchRegistry() {
        boolean success;
        Stopwatch tracer = fetchRegistryTimer.start();

        try {
            // If the delta is disabled or if it is the first time, get all applications
            if (serverConfig.shouldDisableDeltaForRemoteRegions()
                    || (getApplications() == null)
                    || (getApplications().getRegisteredApplications().size() == 0)) {
                logger.info("Disable delta property : {}", serverConfig.shouldDisableDeltaForRemoteRegions());
                logger.info("Application is null : {}", getApplications() == null);
                logger.info("Registered Applications size is zero : {}", getApplications().getRegisteredApplications().isEmpty());
                success = storeFullRegistry();
            } else {
                success = fetchAndStoreDelta();
            }
            logTotalInstances();
        } catch (Throwable e) {
            logger.error("Unable to fetch registry information from the remote registry {}", this.remoteRegionURL, e);
            return false;
        } finally {
            if (tracer != null) {
                tracer.stop();
            }
        }
        return success;
    }
813219
public static synchronized LoadBalancerRegistry getDefaultRegistry() {
    if (instance == null) {
      List<LoadBalancerProvider> providerList = ServiceProviders.loadAll(
          LoadBalancerProvider.class,
          HARDCODED_CLASSES,
          LoadBalancerProvider.class.getClassLoader(),
          new LoadBalancerPriorityAccessor());
      instance = new LoadBalancerRegistry();
      for (LoadBalancerProvider provider : providerList) {
        logger.fine("Service loader found " + provider);
        if (provider.isAvailable()) {
          instance.addProvider(provider);
        }
      }
      instance.refreshProviderMap();
    }
    return instance;
  }
597739
protected RegistryAuth registryAuth() throws MojoExecutionException {
    if (settings != null && serverId != null) {
      final Server server = settings.getServer(serverId);
      if (server != null) {
        final RegistryAuth.Builder registryAuthBuilder = RegistryAuth.builder();

        final String username = server.getUsername();
        String password = server.getPassword();
        if (secDispatcher != null) {
          try {
            password = secDispatcher.decrypt(password);
          } catch (SecDispatcherException ex) {
            throw new MojoExecutionException("Cannot decrypt password from settings", ex);
          }
        }
        final String email = getEmail(server);

        if (!isNullOrEmpty(username)) {
          registryAuthBuilder.username(username);
        }
        if (!isNullOrEmpty(email)) {
          registryAuthBuilder.email(email);
        }
        if (!isNullOrEmpty(password)) {
          registryAuthBuilder.password(password);
        }
        if (!isNullOrEmpty(registryUrl)) {
          registryAuthBuilder.serverAddress(registryUrl);
        }

        return registryAuthBuilder.build();
      } else {
        // settings.xml has no entry for the configured serverId, warn the user
        getLog().warn("No entry found in settings.xml for serverId=" + serverId
                      + ", cannot configure authentication for that registry");
      }
    }
    return null;
  }
777242
public Object lookup(Identity oid)
    {
        Object ret = null;
        if (oid != null)
        {
            ObjectCache cache = getCache(oid, null, METHOD_LOOKUP);
            if (cache != null)
            {
                ret = cache.lookup(oid);
            }
        }
        return ret;
    }
65026
public synchronized RegistrationPoint getOldestRegistrationPoint() {
        return registrationPoints.size() == 0 ? null : registrationPoints.values().iterator().next().get(0);
    }
1078351
public RecursiveTypeRegistry getRegistryForProgramName(String programName) {
        if (localProgramContext.equals(programName)) return this;
        for (RecursiveTypeRegistry registry : includes.values()) {
            if (registry.getLocalProgramContext().equals(programName)) {
                return registry;
            }
        }
        for (RecursiveTypeRegistry registry : includes.values()) {
            RecursiveTypeRegistry tmp = registry.getRegistryForProgramName(programName);
            if (tmp != null) {
                return tmp;
            }
        }
        return null;
    }
922833
public function getConfigurationRegistry()
    {
        if (null === $this->configurationRegistry) {
            $this->configurationRegistry = new Configuration\ConfigurationRegistry();
        }

        return $this->configurationRegistry;
    }
662690
public Enumeration<String> getKeys() {
        // lazily load the lookup hashtable.
        if (lookup == null) {
            loadLookup();
        }

        ResourceBundle parent = this.parent;
        return new ResourceBundleEnumeration(lookup.keySet(),
                (parent != null) ? parent.getKeys() : null);
    }
111017
@NonNull
    public JsonProcessor lookup() {
        JsonProcessor registeredJsonProcessor = this.registeredJsonProcessor;
        if (registeredJsonProcessor != null) {
            return registeredJsonProcessor;
        }

        if (!init) {
            synchronized (this) {
                if (!init) {
                    lookedJsonProcessor = lookupInClasspath();
                    init = true;
                }
            }
        }

        if (lookedJsonProcessor != null) {
            return lookedJsonProcessor;
        }
        throw new JsonProcessorNotFoundException("Json Provider not found");
    }
486133
private function loadRegistry()
    {
        $this->registryCache->setOrm($this);
        try {
            $this->registryCache->isAppReady();
        } catch (AppRegistryNotReady $e) {
            $this->registryCache->populate();
        }
    }
1327194
private static ControllerRegistry build(ControllerLookup lookup) {
        List<BaseController> controllers = new LinkedList<>();
        controllers.addAll(lookup.getControllers());
        return new ControllerRegistry(controllers);
    }
468918
private static void loadRegistry() {
		// Load audit filters to runtime configurations.
		for (AuditEventFilter filter : PreConfigurationContext.getPrefilters()) {
			configContext.addFilter(filter);
		}
		// Load audit annotation filters to runtime configurations.
		for (AuditAnnotationFilter annotationFilter : PreConfigurationContext.getPreannotationfilters()) {
			configContext.addAnnotationFilter(annotationFilter);
		}
	}
623903
public static <T> T lookupProviderByName(final ServiceRegistry registry, final String providerClassName, Class<T> category) {
        try {
            return category.cast(registry.getServiceProviderByClass(Class.forName(providerClassName)));
        }
        catch (ClassNotFoundException ignore) {
            return null;
        }
    }
1189681
private Set<CacheKey> getCacheKeys() {
        Set<CacheKey> cacheKeys = new HashSet<CacheKey>();
        Applications apps = registry.getApplicationsFromLocalRegionOnly();
        for (Application app : apps.getRegisteredApplications()) {
            for (InstanceInfo instanceInfo : app.getInstances()) {
                String localAccountId = getAccountId(instanceInfo, accountId);
                String asgName = instanceInfo.getASGName();
                if (asgName != null) {
                    CacheKey key = new CacheKey(localAccountId, asgName);
                    cacheKeys.add(key);
                }
            }
        }

        return cacheKeys;
    }