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