}
private EvaluationFunction getEvaluationFunction(final VariableService variableService, StatementStopService statementStopService, String hintValue)
throws ExprValidationException
{
final VariableReader variableReader = variableService.getReader(hintValue);
if (variableReader != null)
{
if (!JavaClassHelper.isNumeric(variableReader.getType()))
{
throw new ExprValidationException("Variable type of variable '" + variableReader.getVariableName() + "' is not numeric");
}
final VariableChangeCallback changeCallback = new VariableChangeCallback()
{
public void update(Object newValue, Object oldValue)
{
AggSvcGroupByReclaimAged.this.nextSweepTime = null;
}
};
variableService.registerCallback(variableReader.getVariableNumber(), changeCallback);
statementStopService.addSubscriber(new StatementStopCallback()
{
public void statementStopped()
{
variableService.unregisterCallback(variableReader.getVariableNumber(), changeCallback);
}
});
return new EvaluationFunctionVariable(variableReader);
}