DurationWindow: rename agentContext for consistency

This commit is contained in:
2018-10-30 18:03:08 -07:00
parent 518cf23e6d
commit 0d89384205

View File

@ -28,7 +28,7 @@ class DurationWindow {
.appendMinutes().appendSuffix("m")
.appendSeconds().appendSuffix("s")
.toFormatter();
private final AgentInstanceViewFactoryChainContext agentContext;
private final AgentInstanceViewFactoryChainContext context;
private final long scheduleSlot;
private EPStatementHandleCallback handle;
private final Duration interval;
@ -46,7 +46,7 @@ class DurationWindow {
{
this.plugin = plugin;
this.calc = calc;
agentContext = context;
this.context = context;
scheduleSlot = context.getStatementContext().getScheduleBucket().allocateSlot();
interval = parseInterval(intervalExpression);
}
@ -64,7 +64,7 @@ class DurationWindow {
*/
private Duration parseInterval(ExprNode interval) {
ExprEvaluator evaluator = interval.getForge().getExprEvaluator();
String intervalStr = (String)evaluator.evaluate(null, true, agentContext);
String intervalStr = (String)evaluator.evaluate(null, true, context);
return parseInterval(intervalStr);
}
@ -145,7 +145,7 @@ class DurationWindow {
* Set up a callback to post an event when our time window expires.
*/
private void scheduleCallback(DateTime endTime) {
SchedulingService sched = agentContext.getStatementContext().getSchedulingService();
SchedulingService sched = context.getStatementContext().getSchedulingService();
if (handle != null) {
// remove old schedule
// log.info("Removing old callback");
@ -165,7 +165,7 @@ class DurationWindow {
}
};
handle = new EPStatementHandleCallback(agentContext.getEpStatementAgentInstanceHandle(), callback);
handle = new EPStatementHandleCallback(context.getEpStatementAgentInstanceHandle(), callback);
sched.add(callbackTime, handle, scheduleSlot);
// log.info("Scheduled callback for {}", callbackTime);
}