本文整理汇总了Java中com.typesafe.config.ConfigFactory.invalidateCaches方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigFactory.invalidateCaches方法的具体用法?Java ConfigFactory.invalidateCaches怎么用?Java ConfigFactory.invalidateCaches使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.typesafe.config.ConfigFactory
的用法示例。
在下文中一共展示了ConfigFactory.invalidateCaches方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: before
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
@BeforeClass
public void before() throws IOException {
Path root = Files.createTempFile("stargraph-", "-dataDir");
Path ntPath = createPath(root, factsId).resolve("triples.nt");
copyResource("dataSets/simple/facts/triples.nt", ntPath);
System.setProperty("stargraph.data.root-dir", root.toString());
ConfigFactory.invalidateCaches();
Config config = ConfigFactory.load().getConfig("stargraph");
core = new Stargraph(config, false);
core.setIndexerFactory(new NullIndexerFactory());
core.setModelFactory(new NTriplesModelFactory(core));
core.initialize();
}
示例2: before
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
@BeforeClass
public void before() {
ConfigFactory.invalidateCaches();
Config config = ConfigFactory.load().getConfig("stargraph");
this.core = new Stargraph(config, false);
this.core.setIndexerFactory(new TestDataIndexer.Factory());
this.core.initialize();
this.kbId = KBId.of("mytest", "mytype");
this.indexer = core.getIndexer(kbId);
List<String> expected = Arrays.asList("first", "second", "third");
this.expected = expected.stream().map(s -> new TestData(false, false, s)).collect(Collectors.toList());
}
示例3: beforeClass
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
@BeforeClass
public void beforeClass() throws IOException {
Path root = Files.createTempFile("stargraph-", "-dataDir");
Path factsPath = createPath(root, KBId.of("obama", "facts"));
Path hdtFilePath = factsPath.resolve("triples.hdt");
Path ntFilePath = factsPath.resolve("triples.nt");
copyResource("dataSets/obama/facts/triples.hdt", hdtFilePath);
copyResource("dataSets/obama/facts/triples.nt", ntFilePath);
System.setProperty("stargraph.data.root-dir", root.toString());
ConfigFactory.invalidateCaches();
config = ConfigFactory.load().getConfig("stargraph");
}
示例4: before
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
@BeforeClass
public void before() throws Exception {
Path root = Files.createTempFile("stargraph-", "-dataDir");
Path hdtPath = createPath(root, factsId).resolve("triples.hdt");
copyResource("dataSets/obama/facts/triples.hdt", hdtPath);
System.setProperty("stargraph.data.root-dir", root.toString());
ConfigFactory.invalidateCaches();
stargraph = new Stargraph();
//TODO: replace with KBLoader#loadAll()
loadProperties(stargraph);
loadEntities(stargraph);
loadFacts(stargraph);
}
示例5: setup
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
@BeforeTest
void setup() {
originalOut = System.out;
originalErr = System.err;
System.setOut(new PrintStream(outContent));
System.setErr(new PrintStream(errContent));
asserted = true;
System.setProperty("config.resource", "application-cli.local.conf");
ConfigFactory.invalidateCaches();
}
示例6: set
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public void set(String value){
if(value == null){
System.clearProperty(property);
} else {
System.setProperty(property, value);
}
ConfigFactory.invalidateCaches();
}
示例7: refreshConfig
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static void refreshConfig() {
ConfigFactory.invalidateCaches();
OcraftConfig.inject(ConfigFactory.load());
}
示例8: close
import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
@Override
public void close() {
set(original);
ConfigFactory.invalidateCaches();
}