Package com.google.gerrit.server.rules
Class RulesCache
- java.lang.Object
- 
- com.google.gerrit.server.rules.RulesCache
 
- 
 public class RulesCache extends Object Manages a cache of compiled Prolog rules.Rules are loaded from the site_path/cache/rules/rules-SHA1.jar, whereSHA1is the SHA1 of the Prologrules.plin a project'sRefNames.REFS_CONFIGbranch.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classRulesCache.RulesCacheModule
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedRulesCache(org.eclipse.jgit.lib.Config config, SitePaths site, GitRepositoryManager gm, PluginSetContext<PredicateProvider> predicateProviders, com.google.common.cache.Cache<org.eclipse.jgit.lib.ObjectId,com.googlecode.prolog_cafe.lang.PrologMachineCopy> machineCache)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisProjectRulesEnabled()com.googlecode.prolog_cafe.lang.PrologMachineCopyloadMachine(Project.NameKey project, org.eclipse.jgit.lib.ObjectId rulesId)Locate a cached Prolog machine state, or create one if not available.com.googlecode.prolog_cafe.lang.PrologMachineCopyloadMachine(String name, Reader in)
 
- 
- 
- 
Constructor Detail- 
RulesCache@Inject protected RulesCache(org.eclipse.jgit.lib.Config config, SitePaths site, GitRepositoryManager gm, PluginSetContext<PredicateProvider> predicateProviders, com.google.common.cache.Cache<org.eclipse.jgit.lib.ObjectId,com.googlecode.prolog_cafe.lang.PrologMachineCopy> machineCache)
 
- 
 - 
Method Detail- 
isProjectRulesEnabledpublic boolean isProjectRulesEnabled() 
 - 
loadMachinepublic com.googlecode.prolog_cafe.lang.PrologMachineCopy loadMachine(@Nullable Project.NameKey project, @Nullable org.eclipse.jgit.lib.ObjectId rulesId) throws com.googlecode.prolog_cafe.exceptions.CompileExceptionLocate a cached Prolog machine state, or create one if not available.- Returns:
- a Prolog machine, after loading the specified rules.
- Throws:
- com.googlecode.prolog_cafe.exceptions.CompileException- the machine cannot be created.
 
 
- 
 
-