Retrieves the currently active singleton instance of {@link ConfidentialStore}.
352571
public static @Nonnull ConfidentialStore get() {
        if (TEST!=null) return TEST.get();

        Jenkins j = Jenkins.getInstance();
        Lookup lookup = j.lookup;
        ConfidentialStore cs = lookup.get(ConfidentialStore.class);
        if (cs==null) {
            try {
                Iterator<ConfidentialStore> it = ServiceLoader.load(ConfidentialStore.class, ConfidentialStore.class.getClassLoader()).iterator();
                if (it.hasNext()) {
                    cs = it.next();
                }
            } catch (ServiceConfigurationError e) {
                LOGGER.log(Level.WARNING, "Failed to list up ConfidentialStore implementations",e);
                // fall through
            }

            if (cs==null)
                try {
                    cs = new DefaultConfidentialStore();
                } catch (Exception e) {
                    // if it's still null, bail out
                    throw new Error(e);
                }

            cs = lookup.setIfNull(ConfidentialStore.class,cs);
        }
        return cs;
    }
1150901
public static ReflectionUtil getInstance() {

    if (instance == null) {
      ReflectionUtilImpl impl = null;
      synchronized (ReflectionUtilImpl.class) {
        if (instance == null) {
          impl = new ReflectionUtilImpl();
          instance = impl;
        }
      }
      if (impl != null) {
        // static access is generally discouraged, cyclic dependency forces this ugly initialization to
        // prevent deadlock.
        impl.initialize();
      }
    }
    return instance;
  }
601403
public static DocumentFactory getInstance() {
      if (CONFIGURED_INSTANCE == null) {
         synchronized (DocumentFactory.class) {
            if (CONFIGURED_INSTANCE == null) {
               CONFIGURED_INSTANCE = new DocumentFactory();
            }
         }
      }
      return CONFIGURED_INSTANCE;
   }
87725
public static FixtureManager getInstance() {

        // Employ a "double-checked locking" strategy because a lock is only
        // needed upon initialization; synchronize on the monitor belonging to
        // the class itself.
        if (null == manager) {
            synchronized (FixtureManager.class) {
                // check again, because the thread might have been preempted
                // just after the outer if was processed but before the
                // synchronized statement was executed
                if (manager == null) {
                    manager = new FixtureManager();
                }
            }
        }
        return manager;
    }
1207506
public static function GetActiveInstance()
    {
        static $oInstance = false;
        if (false === $oInstance) {
            /** @var $filterApi FilterApiInterface */
            $filterApi = \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_shop_list_filter.filter_api');
            $baseQuery = $filterApi->getArticleListQuery();

            $oInstance = self::getInstanceForPage(self::getMyActivePageService()->getActivePage(), $baseQuery);
            if (null === $oInstance) {
                return $oInstance;
            }
            $listState = $filterApi->getArticleListFilterRelevantState();
            $oInstance->setListState($listState);

            $oFilterList = &$oInstance->GetFieldPkgShopListfilterItemList();
            $oFilterList->GoToStart();
            $aCloneList = array();
            while ($oFilterItem = &$oFilterList->Next()) {
                $filterQueryRestriction = $oFilterList->GetQueryRestriction($oFilterItem);
                $sBaseQueryHash = 'h'.md5($filterQueryRestriction);
                if (false === isset($aCloneList[$sBaseQueryHash])) {
                    $articleList = TdbShopArticleList::GetList($baseQuery);
                    if ('' !== $filterQueryRestriction) {
                        $articleList->AddFilterString($filterQueryRestriction);
                    }
                    $aCloneList[$sBaseQueryHash] = $articleList;
                }
                $oFilterItem->SetFilteredItemList($aCloneList[$sBaseQueryHash]);
            }
        }

        return $oInstance;
    }
947203
def getFactory(self):
        
        checkers = [self.loginSystem, AllowAnonymousAccess()]
        guardedRoot = PersistentSessionWrapper(
            self.store,
            Portal(self.loginSystem, checkers),
            domains=[self.hostname])
        unguardedRoot = UnguardedWrapper(self.store, guardedRoot)
        securingRoot = SecuringWrapper(self, unguardedRoot)
        logPath = None
        if self.httpLog is not None:
            logPath = self.httpLog.path
        return AxiomSite(self.store, securingRoot, logPath=logPath)
1252941
private <T> T getInstance(DatastoreType datastoreType, TransactionalCache.Mode cacheMode) {
        DatastoreId id = getDatastoreId(datastoreType);
        Object instance = cache.get(id, cacheMode);
        if (instance == null) {
            DynamicType<?> types = getTypes(datastoreType);
            instance = newInstance(id, datastoreType, types, cacheMode);
            if (TransactionalCache.Mode.READ.equals(cacheMode)) {
                instanceListenerService.postLoad(instance);
            }
        }
        return (T) instance;
    }
1083635
@SuppressWarnings("unchecked")
    public synchronized <K, V> StoreClient<K, V> getStoreClient(String storeName,
                                                   InconsistencyResolver<Versioned<V>> resolver) {
        Pair<String, Object> key = Pair.create(storeName, (Object) resolver);
        if(!cache.containsKey(key)) {
            StoreClient<K, V> result = inner.getStoreClient(storeName, resolver);
            cache.putIfAbsent(key, result);
        }

        return (StoreClient<K, V>) cache.get(key);
    }
748187
private static final Object getCurrentUOWCoord() {
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(TRACE, "getCurrentUOWCoord");
        }

        Object currentUOW = null;
        if (isRunningInWAS()) {
            currentUOW = EmbeddableTransactionManagerFactory.getUOWCurrent().getUOWCoord();
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(TRACE, "getCurrentUOWCoord", currentUOW);
        }
        return currentUOW;
    }
869568
def get_instance(cls):
        
        if not cls.prepared:
            raise SingletonNotPreparedError(
                "prepare must be called before get_instance"
            )

        if hasattr(cls.local, 'tchannel') and cls.local.tchannel is not None:
            return cls.local.tchannel

        cls.local.tchannel = cls.tchannel_cls(*cls.args, **cls.kwargs)

        return cls.local.tchannel
1278254
public static IWebAppSecurityCollaborator getCurrentSecurityCollaborator()
  {
      IWebAppSecurityCollaborator currentCollab = null;
      ICollaboratorHelper instance = getCurrentInstance();
      if (instance != null)
          currentCollab = instance.getSecurityCollaborator();
      return currentCollab;
  }
521750
public static SystemUtil getInstance() {

    if (instance == null) {
      synchronized (SystemUtilImpl.class) {
        if (instance == null) {
          instance = new SystemUtilImpl();
        }
      }
    }
    return instance;
  }
591490
public Instance getInstance() {
        DescribeInstancesRequest req = new DescribeInstancesRequest();
        req.setInstanceIds(Collections.singleton(this.getInstanceId()));
        DescribeInstancesResult result = this.ec2Client.describeInstances(req);
        if (result.getReservations().size() != 1) {
            throw new IllegalStateException("Found multiple instances");
        }
        List<Instance> instances = result.getReservations().get(0).getInstances();
        if (instances.size() != 1) {
            throw new IllegalStateException("Found multiple instances");
        }
        return instances.get(0);
    }
205
@Restricted(NoExternalUse.class)
    public static @Nonnull JenkinsLocationConfiguration getOrDie(){
        JenkinsLocationConfiguration config = JenkinsLocationConfiguration.get();
        if (config == null) {
            throw new IllegalStateException("JenkinsLocationConfiguration instance is missing. Probably the Jenkins instance is not fully loaded at this time.");
        }
        return config;
    }
103916
@Override
    public <Instance> DatastoreType getDatastoreType(Instance instance) {
        InstanceInvocationHandler<DatastoreType> invocationHandler = proxyFactory.getInvocationHandler(instance);
        return invocationHandler.getDatastoreType();
    }
247478
public User getActiveUser() {
        SharedPreferences prefs = getStorage();
        if (prefs.contains("uuid") && prefs.contains("name")) {
            return new User(
                    prefs.getString("app_name", ""),
                    prefs.getString("name", ""),
                    prefs.getString("uuid", ""),
                    null);
        } else {
            return null;
        }
    }
18814
public static synchronized ElasticsearchClient getSingleton() {
        if (singleton == null) {
            singleton = new ElasticsearchClient();
            try {
                singleton.init();
            } catch (Exception e) {
                log.log(Level.SEVERE, "Failed to initialise Elasticsearch client", e);
            }
        }
        return singleton;
    }