diff options
author | David A. Madore <david+git@madore.org> | 2014-10-09 20:40:26 +0200 |
---|---|---|
committer | David A. Madore <david+git@madore.org> | 2014-10-09 20:40:26 +0200 |
commit | cde90f22cc34b898c684c9de78c5e93022dbd42a (patch) | |
tree | 39cbca2edfa3acdfb640e64ca9ff3803fdcd08cc /org/madore/damlengine/DamlEngine.java | |
parent | 827925b57dc5ba84e480cf9c66ff2cb13a096780 (diff) | |
download | damlengine-cde90f22cc34b898c684c9de78c5e93022dbd42a.tar.gz damlengine-cde90f22cc34b898c684c9de78c5e93022dbd42a.tar.bz2 damlengine-cde90f22cc34b898c684c9de78c5e93022dbd42a.zip |
Add a "dynamic context" global state, and make WeblogSummary stale when too old.
Diffstat (limited to 'org/madore/damlengine/DamlEngine.java')
-rw-r--r-- | org/madore/damlengine/DamlEngine.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/org/madore/damlengine/DamlEngine.java b/org/madore/damlengine/DamlEngine.java index cffd589..4826cf1 100644 --- a/org/madore/damlengine/DamlEngine.java +++ b/org/madore/damlengine/DamlEngine.java @@ -115,20 +115,28 @@ public final class DamlEngine { } public static void processDocument(Document doc, - Context.WeblogSelectionContext wsc) { + Context.WeblogSelectionContext wsc, + Context.DynamicContext dc) { TodoDeque todoDeque = new TodoDeque(); Context ctx = new Context(doc); ctx.wsc = wsc; + ctx.dc = dc; todoDeque.registerAtEnd(new RootTodo(ctx)); todoDeque.dispatchLoop(); } + public static void processDocument(Document doc, + Context.WeblogSelectionContext wsc) { + processDocument(doc, wsc, null); + } + public static void processDocument(Document doc) { - processDocument(doc, null); + processDocument(doc, null, null); } public static void fullProcess(InputStream in, OutputStream out, - Context.WeblogSelectionContext wsc) + Context.WeblogSelectionContext wsc, + Context.DynamicContext dc) throws Exception { final DOMImplementationLS domils @@ -142,7 +150,7 @@ public final class DamlEngine { LSInput input = domils.createLSInput(); input.setByteStream(in); Document doc = par.parse(input); - processDocument(doc, wsc); + processDocument(doc, wsc, dc); doc.normalizeDocument(); Unparser unparser = new Unparser(doc, new OutputStreamWriter(out, "UTF-8"), @@ -151,9 +159,15 @@ public final class DamlEngine { } + public static void fullProcess(InputStream in, OutputStream out, + Context.WeblogSelectionContext wsc) + throws Exception { + fullProcess(in, out, wsc, null); + } + public static void fullProcess(InputStream in, OutputStream out) throws Exception { - fullProcess(in, out, null); + fullProcess(in, out, null, null); } public static boolean runAsServlet = false; |