Package org.rhq.enterprise.server.resource.group.definition.framework

Examples of org.rhq.enterprise.server.resource.group.definition.framework.ExpressionEvaluator.addExpression()


        boolean valid = true;
        try {
            ExpressionEvaluator evaluator = new ExpressionEvaluator();
            evaluator.setTestMode(true); // to prevent actual query from happening
            for (String expr : cge.getExpression()) {
                evaluator.addExpression(expr);
            }
            evaluator.execute();
           
        } catch (Exception ex) {
            log.error("Failed to evaluate [expression], evaluator result : "+ex.getMessage());
View Full Code Here


        }
       
        try {
            ExpressionEvaluator evaluator = new ExpressionEvaluator();
            for (String expression : definition.getExpressionAsList()) {
                evaluator.addExpression(expression);
            }
        } catch (InvalidExpressionException e) {
            throw new GroupDefinitionException("Cannot parse the expression: " + e.getMessage());
        }
View Full Code Here

        GroupDefinition groupDefinition = getById(groupDefinitionId);
        groupDefinition.setLastCalculationTime(System.currentTimeMillis()); // we're calculating now

        ExpressionEvaluator evaluator = new ExpressionEvaluator();
        for (String expression : groupDefinition.getExpressionAsList()) {
            evaluator.addExpression(expression);
        }

        Collection<Integer> doomedResourceGroupIds = new ArrayList<Integer>();
        for (Integer managedGroupId : getManagedResourceGroupIdsForGroupDefinition(groupDefinitionId)) {
            doomedResourceGroupIds.add(managedGroupId);
View Full Code Here

                ExpressionEvaluator evaluator = new ExpressionEvaluator();
                evaluator.setTestMode(true); // to prevent actual query from happening
                for (String expression : inputExpressions.split(";")) {
                    try {
                        evaluator.addExpression(expression); // do not trim, evaluator must handle sloppy expressions
                    } catch (Exception e) {
                        e.printStackTrace(System.out);
                        assert false : "Error in TestCase[" + i + "], could not add expression[" + expression
                            + "], input[" + inputExpressions + "]";
                    }
View Full Code Here

    private void evaluateExpressions(ExpressionGenerator generator) throws Exception {
        try {
            getTransactionManager().begin();
            ExpressionEvaluator evaluator = new ExpressionEvaluator();
            for (String expression : generator.getExpressions()) {
                evaluator.addExpression(expression);
            }
            evaluator.execute();
            evaluator.iterator().next();
        } finally {
            getTransactionManager().rollback();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.