Method to initialize the Cache of this CacheObjectInterface.

@param _class class that called the method
@throws CacheReloadException on error
171577
public static void initialize(final Class<?> _class)
        throws CacheReloadException
    {
        if (InfinispanCache.get().exists(Dimension.UUIDCACHE)) {
            InfinispanCache.get().<UUID, Dimension>getCache(Dimension.UUIDCACHE).clear();
        } else {
            InfinispanCache.get().<UUID, Dimension>getCache(Dimension.UUIDCACHE)
                            .addListener(new CacheLogListener(Dimension.LOG));
        }
        if (InfinispanCache.get().exists(Dimension.IDCACHE)) {
            InfinispanCache.get().<Long, Dimension>getCache(Dimension.IDCACHE).clear();
        } else {
            InfinispanCache.get().<Long, Dimension>getCache(Dimension.IDCACHE)
                            .addListener(new CacheLogListener(Dimension.LOG));
        }
        if (InfinispanCache.get().exists(Dimension.NAMECACHE)) {
            InfinispanCache.get().<String, Dimension>getCache(Dimension.NAMECACHE).clear();
        } else {
            InfinispanCache.get().<String, Dimension>getCache(Dimension.NAMECACHE)
                            .addListener(new CacheLogListener(Dimension.LOG));
        }
        if (InfinispanCache.get().exists(Dimension.IDCACHE4UOM)) {
            InfinispanCache.get().<Long, UoM>getCache(Dimension.IDCACHE4UOM).clear();
        } else {
            InfinispanCache.get().<Long, UoM>getCache(Dimension.IDCACHE4UOM)
                            .addListener(new CacheLogListener(Dimension.LOG));
        }
    }
692774
public static void initialize(final Class<?> _class)
        throws CacheReloadException
    {
        if (InfinispanCache.get().exists(Type.UUIDCACHE)) {
            InfinispanCache.get().<UUID, Type>getCache(Type.UUIDCACHE).clear();
        } else {
            InfinispanCache.get().<UUID, Type>getCache(Type.UUIDCACHE).addListener(new CacheLogListener(Type.LOG));
        }
        if (InfinispanCache.get().exists(Type.IDCACHE)) {
            InfinispanCache.get().<Long, Type>getCache(Type.IDCACHE).clear();
        } else {
            InfinispanCache.get().<Long, Type>getCache(Type.IDCACHE).addListener(new CacheLogListener(Type.LOG));
        }
        if (InfinispanCache.get().exists(Type.NAMECACHE)) {
            InfinispanCache.get().<String, Type>getCache(Type.NAMECACHE).clear();
        } else {
            InfinispanCache.get().<String, Type>getCache(Type.NAMECACHE).addListener(new CacheLogListener(Type.LOG));
        }
        if (InfinispanCache.get().exists(EnumType.CACHE)) {
            InfinispanCache.get().getCache(EnumType.CACHE).clear();
        }
        QueryCache.initialize();
    }
616997
public static void removeCache(Class<? extends BaseEntity> entityClass){
		if(CacheHandler.cacheProvider == null)return;
		String entityClassName = entityClass.getSimpleName();
		CacheHandler.cacheProvider.clearGroup(entityClassName,true);
	}
223148
public static void init(Context context, String name, int version, int cacheSize) {
		init(context, name, version, cacheSize, LogLevel.NONE);
	}
1216179
@Override
    protected void setProperty(final String _name,
                               final String _value)
        throws CacheReloadException
    {
        if ("ReadOnly".equals(_name)) {
            this.readOnly = "true".equalsIgnoreCase("true");
        }
    }
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);
    }
721336
private function initAdmingeneratorClassLoader($cacheDir)
    {
        if ($this->classLoaderInitialized) {
            return;
        }

        $this->classLoaderInitialized = true;

        $admingeneratedClassLoader = new AdmingeneratedClassLoader();
        $admingeneratedClassLoader->setBasePath($cacheDir);
        $admingeneratedClassLoader->register();
    }
706263
protected static function _initialize($class) {
		$self = parent::_initialize($class);
		if (!$self->_inited) {
			$self->_inited = true;
			$self->_init();
		}
		return $self;
	}
255391
public static void initialize()
    {
        if (InfinispanCache.get().exists(Field.IDCACHE)) {
            InfinispanCache.get().<Long, Field>getCache(Field.IDCACHE).clear();
        } else {
            InfinispanCache.get().<Long, Field>getCache(Field.IDCACHE);
            InfinispanCache.get().<Long, Field>getCache(Field.IDCACHE).addListener(new CacheLogListener(Field.LOG));
        }
    }
65398
private ObjectCache getCachePerClass(Class objectClass, int methodCall)
    {
        ObjectCache cache = (ObjectCache) cachesByClass.get(objectClass.getName());
        if (cache == null && AbstractMetaCache.METHOD_CACHE == methodCall
                && !cachesByClass.containsKey(objectClass.getName()))
        {
            cache = new ObjectCacheDefaultImpl(null, null);
            setClassCache(objectClass.getName(), cache);
        }
        return cache;
    }
240548
private static function initPropertyCache($class) {
        $loops = $class instanceof Object ? $class->getLoops() : Loops::getCurrentLoops();
        $classname = get_class($class);
        $key = "Loops-Misc-AccessTrait-$classname";

        static $cache;

        if(!$cache) {
            $cache = new ChainCache([new ArrayCache, $loops->getService("cache")]);
        }

        if($cache->contains($key)) {
            return $cache->fetch($key);
        }

        $annotations = $loops->getService("annotations");

        // build
        $result["getter"]    = [];
        $result["setter"]    = [];
        $result["exposed"]   = [];
        $result["protected"] = [];
        $result["sleep"]     = [];

        $ro = $annotations->get($classname)->properties->findFirst("Access\ReadOnly");
        $rw = $annotations->get($classname)->properties->findFirst("Access\ReadWrite");

        //make getter
        foreach(array_merge($ro, $rw) as $name => $annotation) {
            if($annotation->getter && !method_exists($class, $annotation->getter)) {
                throw new Exception("Passed getter '{$annotation->getter}' is not a method of class '$classname'.");
            }
            $result["getter"][$name] = $annotation->getter ? [ $annotation->getter, $annotation->arguments ] : $name;
        }

        //make setter
        foreach($rw as $name => $annotation) {
            if($annotation->setter && !method_exists($class, $annotation->setter)) {
                throw new Exception("Passed getter '{$annotation->setter}' is not a method of class '$classname'.");
            }
            $result["setter"][$name] = $annotation->setter ? [ $annotation->setter ] : $name;
        }

        //expose public properties
        foreach((new ReflectionClass($classname))->getProperties() as $property) {
            if($property->isStatic()) {
                continue;
            }

            if($property->isPublic()) {
                $name = $property->getName();
                $result["getter"][$name]  = $name;
                $result["setter"][$name]  = $name;
                $result["exposed"][$name] = $name;
            }

            if($property->isProtected()) {
                $name = $property->getName();
                $result["protected"][$name] = $name;
            }
        }

        //expose properties that have the Exposed annotation - prefer getter of property if exists
        foreach($annotations->get($classname)->properties->findLast("Access\Expose") as $name => $annotation) {
            $result["exposed"][$annotation->name ?: $name] = array_key_exists($name, $result["getter"]) ? $result["getter"][$name] : $name;
        }

        //expose methods that have the Exposed annotation
        foreach($annotations->get($classname)->methods->findLast("Access\Expose") as $name => $annotation) {
            $result["exposed"][$annotation->name ?: $name] = [ $name, $annotation->arguments ];
        }

        //check, which keys must be imported when sleeping
        $current = $classname;
        do {
            $set = $annotations->getStrict($current);

            $properties = array_keys(iterator_to_array($set->properties));

            $properties = array_filter($properties, function($name) use ($current) {
                $property = new ReflectionProperty($current, $name);
                if($property->isStatic()) return FALSE;
                if($property->isPrivate()) return FALSE;
                return TRUE;
            });

            foreach($set->find("Access\Sleep") as $sleep) {
                if($sleep->forbid) {
                    $result["sleep"] = FALSE;
                    break 2;
                }

                if($sleep->include) {
                    $properties = array_intersect($properties, $sleep->include);
                }

                if($sleep->exclude) {
                    $properties = array_diff($properties, $sleep->exclude);
                }
            }

            $result["sleep"] = array_merge($result["sleep"], $properties);
        } while($current = get_parent_class($current));

        $cache->save($key, $result);

        return $result;
    }
1374198
private void init() {
        cacheable = null;
        status = SC_OK;
        cachedResponse = cached.createCachedResponse();
        streamDelegate = new ServletResponseStreamDelegate(this) {
            protected OutputStream createOutputStream() throws IOException {
                // Test if this request is really cacheable, otherwise,
                // just write through to underlying response, and don't cache
                if (isCacheable()) {
                    return cachedResponse.getOutputStream();
                }
                else {
                    cachedResponse.setStatus(status);
                    cachedResponse.writeHeadersTo(CacheResponseWrapper.this.response);
                    return super.getOutputStream();
                }
            }
        };
    }
1373335
public void setStorageClass(StorageClass storageClass) {
        setStorageClass(storageClass == null ? (String)null : storageClass.toString());
    }
433668
public static void initialize()
        throws CacheReloadException
    {
        if (InfinispanCache.get().exists(Store.UUIDCACHE)) {
            InfinispanCache.get().<UUID, Store>getCache(Store.UUIDCACHE).clear();
        } else {
            InfinispanCache.get().<UUID, Store>getCache(Store.UUIDCACHE).addListener(new CacheLogListener(Store.LOG));
        }
        if (InfinispanCache.get().exists(Store.IDCACHE)) {
            InfinispanCache.get().<Long, Store>getCache(Store.IDCACHE).clear();
        } else {
            InfinispanCache.get().<Long, Store>getCache(Store.IDCACHE).addListener(new CacheLogListener(Store.LOG));
        }
        if (InfinispanCache.get().exists(Store.NAMECACHE)) {
            InfinispanCache.get().<String, Store>getCache(Store.NAMECACHE).clear();
        } else {
            InfinispanCache.get().<String, Store>getCache(Store.NAMECACHE).addListener(new CacheLogListener(Store.LOG));
        }
    }
1269720
public static void initialize()
        throws CacheReloadException
    {
        Context.getDbType().initialize(AbstractDataModelObject.class);
        AttributeType.initialize(AbstractDataModelObject.class);
        SQLTable.initialize(AbstractDataModelObject.class);
        Type.initialize(AbstractDataModelObject.class);
        Dimension.initialize(AbstractDataModelObject.class);
        Attribute.initialize(AbstractDataModelObject.class);
        Status.initialize(AbstractDataModelObject.class);
    }
9239
private void cacheClass(ClassSource classSource, String outerClassName) {
        if (classCacheMode != UserCodeDeploymentConfig.ClassCacheMode.OFF) {
            classSourceMap.put(outerClassName, classSource);
        } else {
            ThreadLocalClassCache.store(outerClassName, classSource);
        }
    }
1057768
public void cache(Class<?> cls) {
        if (cls != null) {
            classes.put(cls.getName(), new SoftReference<Class<?>>(cls));
        }
    }