Skip to content

Commit

Permalink
0001231: Bind initialLoad flag to the beanshell data router so it can…
Browse files Browse the repository at this point in the history
… making routing decisions on initial load
  • Loading branch information
chenson42 committed May 17, 2013
1 parent 8125a16 commit 7585f21
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -59,7 +59,7 @@ public Set<String> routeToNodes(SimpleRouterContext context, DataMetaData dataMe
context.incrementStat(System.currentTimeMillis() - ts, "bsh.init.ms");
HashSet<String> targetNodes = new HashSet<String>();
ts = System.currentTimeMillis();
bind(interpreter, dataMetaData, nodes, targetNodes);
bind(interpreter, dataMetaData, nodes, targetNodes, initialLoad);
context.incrementStat(System.currentTimeMillis() - ts, "bsh.bind.ms");
ts = System.currentTimeMillis();
Object returnValue = interpreter.eval(dataMetaData.getTriggerRouter().getRouter().getRouterExpression());
Expand Down Expand Up @@ -104,9 +104,10 @@ protected Set<String> eval(Object value, Set<Node> nodes, Set<String> targetNode
}
}

protected void bind(Interpreter interpreter, DataMetaData dataMetaData, Set<Node> nodes, Set<String> targetNodes)
protected void bind(Interpreter interpreter, DataMetaData dataMetaData, Set<Node> nodes, Set<String> targetNodes, boolean initialLoad)
throws EvalError {
interpreter.set("log", log);
interpreter.set("initialLoad", initialLoad);
interpreter.set("dataMetaData", dataMetaData);
interpreter.set("nodes", nodes);
interpreter.set("identityNodeId", engine.getNodeService().findIdentityNodeId());
Expand Down

0 comments on commit 7585f21

Please sign in to comment.