Starts the ___protobuf_metadata cache when needed. This method must be invoked for each cache that uses protobuf.

@param dependantCacheName the name of the cache depending on the protobuf metadata cache
540396
protected void addCacheDependency(String dependantCacheName) {
      protobufSchemaCache = (Cache<String, String>) SecurityActions.getUnwrappedCache(cacheManager, PROTOBUF_METADATA_CACHE_NAME).getAdvancedCache().withEncoding(IdentityEncoder.class);
      // add stop dependency
      cacheManager.addCacheDependency(dependantCacheName, ProtobufMetadataManagerImpl.PROTOBUF_METADATA_CACHE_NAME);
   }
659879
@Override
	public void initialized(ICacheManager cacheManager) {
		final String sourceMethod = "initialized"; //$NON-NLS-1$
		final boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(sourceClass, sourceMethod);
		}
		// Cache manager is initialized.  De-register the listener and add our named cache
		cacheMgrListenerReg.unregister();
		JsxConverter converter = newConverter();
		IGenericCache cache = newCache(converter, "jsx.", ""); //$NON-NLS-1$ //$NON-NLS-2$
		cache.setAggregator(aggregator);
		ResourceConverterCacheImpl oldCache = (ResourceConverterCacheImpl)cacheManager.getCache().putIfAbsent(JSX_CACHE_NAME, cache);
		if (oldCache != null) {
			converter = (JsxConverter)oldCache.getConverter();
		}
		if (isTraceLogging) {
			log.logp(Level.FINER, sourceClass, sourceMethod, "Initializing resource converter" + (oldCache != null ? " from cache." : ".")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
		}
		converter.initialize(es, xformerRes.getURI());

		if (isTraceLogging) {
			log.exiting(sourceClass, sourceMethod);
		}
	}
669108
private static ProtobufMetadataManagerImpl getProtobufMetadataManager(EmbeddedCacheManager cacheManager) {
      if (cacheManager == null) {
         throw new IllegalArgumentException("cacheManager cannot be null");
      }
      ProtobufMetadataManagerImpl metadataManager = (ProtobufMetadataManagerImpl) cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
      if (metadataManager == null) {
         throw new IllegalStateException("ProtobufMetadataManager not initialised yet!");
      }
      return metadataManager;
   }
243503
private void loadProtoClassToCache(String key, Class clazz, String methodName) {
        Method pbMethod = null;
        Method[] methods = clazz.getMethods();
        for (Method method : methods) {
            if (methodName.equals(method.getName())) {
                pbMethod = method;
                break;
            }
        }
        if (pbMethod == null) {
            throw new SofaRpcRuntimeException("Cannot found protobuf method: " + clazz.getName() + "." + methodName);
        }
        Class[] parameterTypes = pbMethod.getParameterTypes();
        if (parameterTypes == null
            || parameterTypes.length != 1
            || isProtoBufMessageObject(parameterTypes[0])) {
            throw new SofaRpcRuntimeException("class based protobuf: " + clazz.getName()
                + ", only support one protobuf parameter!");
        }
        Class reqClass = parameterTypes[0];
        requestClassCache.put(key, reqClass);
        Class resClass = pbMethod.getReturnType();
        if (resClass == void.class || !isProtoBufMessageClass(resClass)) {
            throw new SofaRpcRuntimeException("class based protobuf: " + clazz.getName()
                + ", only support return protobuf message!");
        }
        responseClassCache.put(key, resClass);
    }
340451
@Inject
   protected void init(EmbeddedCacheManager cacheManager, InternalCacheRegistry internalCacheRegistry) {
      this.cacheManager = cacheManager;
      internalCacheRegistry.registerInternalCache(PROTOBUF_METADATA_CACHE_NAME,
            getProtobufMetadataCacheConfig().build(),
            EnumSet.of(Flag.USER, Flag.PROTECTED, Flag.PERSISTENT));
   }
988526
private void deliverCacheUpdate(SlotReference slot, MetadataCache cache) {
        for (final MetadataCacheListener listener : getCacheListeners()) {
            try {
                if (cache == null) {
                    listener.cacheDetached(slot);
                } else {
                    listener.cacheAttached(slot, cache);
                }
            } catch (Throwable t) {
                logger.warn("Problem delivering metadata cache update to listener", t);
            }
        }
    }
304287
@SuppressWarnings("unchecked")
  @Override
  public SpringCache2kCache getCache(final String name) {
    return name2cache.computeIfAbsent(name, n -> {
        if (!allowUnknownCache && !configuredCacheNames.contains(n)) {
          throw new IllegalArgumentException("Cache configuration missing for: " + n);
        }
        return buildAndWrap(Cache2kBuilder.forUnknownTypes().manager(manager).name(n));
      });
  }
86956
public void cacheCleared(String cacheName) {
            InvalidationTableList list = (InvalidationTableList) cacheinvalidationTables.get(cacheName);
            if (list != null ) 
                    list.clear();
	}
1195083
public void onCacheMiss(String template, int locality) {
        final String methodName = "onCacheMiss()";

        CacheStatsModule csm = null;
        if ((csm = getCSM(template)) == null) {
            return;
        }
        if (tc.isDebugEnabled())
            Tr.debug(tc, methodName + " cacheName=" + _sCacheName + " template=" + template + " locality=" + locality + " enable=" + csm._enable
                    + " " + this);
        if (csm._enable && csm._missCount != null)
            csm._missCount.increment();
        return;
    }
792965
def set_metadata_cache(cache):
    
    global _METADATA_CACHE

    if _METADATA_CACHE and _METADATA_CACHE.is_open:
        _METADATA_CACHE.close()

    _METADATA_CACHE = cache
1266932
protected function _setServiceCache($serviceCache)
    {
        if ($serviceCache !== null && !($serviceCache instanceof ContainerInterface)) {
            throw $this->_createInvalidArgumentException($this->__('Invalid cache'), null, null, $serviceCache);
        }

        $this->serviceCache = $serviceCache;
    }
176625
public static void start(final Cache<Serializable, Object> cache)
   {
      PrivilegedAction<Object> action = new PrivilegedAction<Object>()
      {
         public Object run()
         {
            cache.start();
            return null;
         }
      };
      SecurityHelper.doPrivilegedAction(action);
   }
894803
public <K, V> Cache<K, V> initCache(final String _cacheName)
    {
        if (!exists(_cacheName)
                        &&  ((EmbeddedCacheManager) getContainer()).getCacheConfiguration(_cacheName) == null) {
            ((EmbeddedCacheManager) getContainer()).defineConfiguration(_cacheName, "eFaps-Default",
                            new ConfigurationBuilder().build());
        }
        return this.container.getCache(_cacheName, true);
    }
653540
private void initializeCaches(Map<String, Object> configProps) {
        final String METHODNAME = "initializeCaches(DataObject)";

        /*
         * initialize the cache pool names
         */
        iAttrsCacheName = iReposId + "/" + iAttrsCacheName;
        iSearchResultsCacheName = iReposId + "/" + iSearchResultsCacheName;

        List<Map<String, Object>> cacheConfigs = Nester.nest(CACHE_CONFIG, configProps);
        Map<String, Object> attrCacheConfig = null;
        Map<String, Object> searchResultsCacheConfig = null;

        if (!cacheConfigs.isEmpty()) {
            Map<String, Object> cacheConfig = cacheConfigs.get(0);
            Map<String, List<Map<String, Object>>> cacheInfo = Nester.nest(cacheConfig, ATTRIBUTES_CACHE_CONFIG, SEARCH_CACHE_CONFIG);
            List<Map<String, Object>> attrList = cacheInfo.get(ATTRIBUTES_CACHE_CONFIG);
            if (!attrList.isEmpty()) {
                attrCacheConfig = attrList.get(0);
            }
            List<Map<String, Object>> searchList = cacheInfo.get(SEARCH_CACHE_CONFIG);
            if (!searchList.isEmpty()) {
                searchResultsCacheConfig = searchList.get(0);
            }

            if (attrCacheConfig != null) {
                iAttrsCacheEnabled = (Boolean) attrCacheConfig.get(CONFIG_PROP_ENABLED);
                if (iAttrsCacheEnabled) {
                    // Initialize the Attributes Cache size
                    iAttrsCacheSize = (Integer) attrCacheConfig.get(CONFIG_PROP_CACHE_SIZE);
                    iAttrsCacheTimeOut = (Long) attrCacheConfig.get(CONFIG_PROP_CACHE_TIME_OUT);
                    iAttrsSizeLmit = (Integer) attrCacheConfig.get(CONFIG_PROP_ATTRIBUTE_SIZE_LIMIT);
                    /*
                     * TODO:: Cache Distribution is not yet needed.
                     * String cacheDistPolicy = attrCacheConfig.getString(CONFIG_PROP_CACHE_DIST_POLICY);
                     * if (cacheDistPolicy != null) {
                     * iAttrsCacheDistPolicy = LdapHelper.getCacheDistPolicyInt(cacheDistPolicy);
                     * }
                     */
                }
            }

            if (searchResultsCacheConfig != null) {
                iSearchResultsCacheEnabled = (Boolean) searchResultsCacheConfig.get(CONFIG_PROP_ENABLED);
                if (iSearchResultsCacheEnabled) {
                    // Initialize the Search Results Cache size
                    iSearchResultsCacheSize = (Integer) searchResultsCacheConfig.get(CONFIG_PROP_CACHE_SIZE);
                    iSearchResultsCacheTimeOut = (Long) searchResultsCacheConfig.get(CONFIG_PROP_CACHE_TIME_OUT);
                    iSearchResultSizeLmit = (Integer) searchResultsCacheConfig.get(CONFIG_PROP_SEARCH_RESULTS_SIZE_LIMIT);

                    /*
                     * TODO:: Cache Distribution is not yet needed.
                     * String cacheDistPolicy = searchResultsCacheConfig.getProperties().get(ConfigConstants.CONFIG_PROP_CACHE_DIST_POLICY);
                     * if (cacheDistPolicy != null) {
                     * iSearchResultsCacheDistPolicy = LdapHelper.getCacheDistPolicyInt(cacheDistPolicy);
                     * }
                     */
                }
            }
        }
        if (iAttrsCacheEnabled) {
            createAttributesCache();

            if (iAttrsCache == null) {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, METHODNAME + " Attributes Cache: " + iAttrsCacheName + " is not available because cache is not available yet.");
                }
            }
        } else {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, METHODNAME + " Attributes Cache: " + iAttrsCacheName + " is disabled.");
            }
        }
        if (iSearchResultsCacheEnabled) {
            createSearchResultsCache();
            if (iSearchResultsCache == null) {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, METHODNAME + " Search Results Cache: " + iSearchResultsCacheName + " is not available because cache is not available yet.");
                }
            }
        } else {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, METHODNAME + " Search Results Cache: " + iSearchResultsCacheName + " is disabled.");
            }
        }
    }
1299142
private function initializeDependencyMap (array $config, array $prefixedNamespaces, ContainerBuilder $container) : void
    {
        $registry = new NamespaceRegistry($prefixedNamespaces);
        $loader = new DependencyLoader($registry);

        foreach ($config["dependency_maps"] as $dependencyMap)
        {
            $loader->importFile($dependencyMap);
        }

        $container->getDefinition(DependencyMapFactory::class)
            ->setArgument('$dependencyFiles', $config["dependency_maps"])
            ->setArgument('$precompiledDependencyMap', $loader->getDependencyMap());
    }
425993
protected void initCaches(int cacheSize) {

        m_offlineJsps = CmsMemoryMonitor.createLRUCacheMap(cacheSize);
        m_onlineJsps = CmsMemoryMonitor.createLRUCacheMap(cacheSize);
    }
11314
public void createExpirationMetaData(DCache cache) {
        //final String methodName = "createExpirationMetaData()";
        ExpirationMetaData expirationMetaData = (ExpirationMetaData)cacheInstancesTable.get(cache);
        if (expirationMetaData == null) {
            int initialTableSize = DEFAULT_SIZE_FOR_MEM;
            if (cache.getSwapToDisk() && cache.getCacheConfig().getDiskCachePerformanceLevel() == CacheConfig.HIGH) {
                initialTableSize = DEFAULT_SIZE_FOR_MEM_DISK;
            }
            expirationMetaData = new ExpirationMetaData(initialTableSize);
            cacheInstancesTable.put(cache, expirationMetaData);
        }
    }