Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reflection 反射包是否缓存资源_Reflection_Classpath_Reflections - Fatal编程技术网

Reflection 反射包是否缓存资源

Reflection 反射包是否缓存资源,reflection,classpath,reflections,Reflection,Classpath,Reflections,我正在使用包扫描类路径中的一些文件。下面的代码定期运行。基本上,我是在类路径的“tmp”文件夹中检索所有xml文件。此代码正在从web应用程序运行 Reflections reflections = new Reflections("tmp", new ResourcesScanner()); Set<String> xmls = reflections.getResources(Pattern.compile(".*\\.xml")); Reflections=newreflec

我正在使用包扫描类路径中的一些文件。下面的代码定期运行。基本上,我是在类路径的“tmp”文件夹中检索所有xml文件。此代码正在从web应用程序运行

Reflections reflections = new Reflections("tmp", new ResourcesScanner());
Set<String> xmls = reflections.getResources(Pattern.compile(".*\\.xml"));
Reflections=newreflections(“tmp”,new resourcescanner());
设置xmls=reflections.getResources(Pattern.compile(\\\.xml));

当我在services文件夹中添加另一个xml文件时,它会被读取。但是,当我更新这些xml文件时,不会反映更新。那里有什么缓存吗?如果是,是否仍有避免相同情况的方法?

否,反射不会缓存资源。它只是扫描并创建一个存储对象,实际上是一个字符串的多重映射

在运行时根据资源的名称(通过存储)读取/检索资源,并使用配置的类加载器(默认为上下文类加载器)