Class 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, where SHA1 is the SHA1 of the Prolog rules.pl in a project's RefNames.REFS_CONFIG branch.

    • Method Detail

      • isProjectRulesEnabled

        public boolean isProjectRulesEnabled()
      • loadMachine

        public com.googlecode.prolog_cafe.lang.PrologMachineCopy loadMachine​(Project.NameKey project,
                                                                             org.eclipse.jgit.lib.ObjectId rulesId)
                                                                      throws com.googlecode.prolog_cafe.exceptions.CompileException
        Locate 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.
      • loadMachine

        public com.googlecode.prolog_cafe.lang.PrologMachineCopy loadMachine​(String name,
                                                                             Reader in)
                                                                      throws com.googlecode.prolog_cafe.exceptions.CompileException
        Throws:
        com.googlecode.prolog_cafe.exceptions.CompileException