Package org.codehaus.aspectwerkz.definition.expression

Examples of org.codehaus.aspectwerkz.definition.expression.Expression


        List interfaceIntroductionDefs = new ArrayList();
        for (Iterator it = m_interfaceIntroductionMap.values().iterator(); it.hasNext();) {
            InterfaceIntroductionDefinition introDef = (InterfaceIntroductionDefinition)it.next();
            for (int i = 0; i < introDef.getExpressions().length; i++) {
                Expression expression = introDef.getExpressions()[i];
                if (expression.isOfType(PointcutType.CLASS) && expression.match(classMetaData, PointcutType.CLASS)) {
                    interfaceIntroductionDefs.add(introDef);
                }
            }
        }
        // add introduction definitions as well
View Full Code Here


            PointcutManager aspect = SystemLoader.getSystem(uuid).getAspectManager().
                    getPointcutManager(aspectDef.getName());

            for (Iterator it2 = aspectDef.getAllAdvices().iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();
                Expression expression = adviceDef.getExpression();

                for (Iterator it3 = expression.getCflowExpressions().entrySet().iterator(); it3.hasNext();) {
                    Map.Entry entry = (Map.Entry)it3.next();
                    Expression value = (Expression)entry.getValue();

                    if (value instanceof ExpressionExpression) {

                        // recursive
                        // TODO ALEX exprexpr using exprexpr
                        // like pc cflow = "a or b"
                        // .. pc exec = "c IN cflow"
                        (new Exception("todo")).printStackTrace();
                    }
                    else {
                        // get the referenced cflow poincut definition
                        PointcutDefinition cflowPointcutDef = aspectDef.getPointcutDef(value.getName());

                        // if null, it is an anonymous cflow like in "execution(..) AND cflow(...)"
                        // create a new PoincutDef lately to bind it
                        // TODO check me - not needed since anonymous are autonamed ?
                        if (cflowPointcutDef == null) {
                            cflowPointcutDef = new PointcutDefinition();
                            cflowPointcutDef.setName(value.getName());
                            cflowPointcutDef.setType(PointcutType.CFLOW);
                            cflowPointcutDef.setExpression(value.getExpression());
                        }

                        // create call pointcut
                        Pointcut pointcut = new Pointcut(uuid, value);
View Full Code Here

//        else {
//            return EMTPTY_ARRAY_LIST;
////            throw new RuntimeException("TODO: cflow for @CALL @GET/SET ...");
//        }
        for (Iterator it = pointcutListToLookIn.iterator(); it.hasNext();) {
            Expression expression = ((Pointcut)it.next()).getExpression();
            // filter out if does not contains CFLOW exprs
            // and ignores CFLOW only expression (since they are CALL pc with CFlowSystemAspect bounded, which
            // must not be filtered out)
            if (expression.isOfType(PointcutType.CFLOW)
                && expression.getTypes().size()>1
                && expression.match(classMetaData, memberMetaData, pointcutType)) {


                // generate a minimalist expression like "TRUE AND cflow OR FALSE"
                // where TRUE , FALSE etc is the result of the match as done at TF time
                expressions.add(expression.extractCflowExpression(classMetaData, memberMetaData, pointcutType));
            }
        }
        return expressions;
    }
View Full Code Here

            final String aspectClassName,
            final String expression,
            final Method method,
            final int methodIndex,
            final AspectDefinition aspectDef) {
        Expression expr = ExpressionNamespace.getExpressionNamespace(aspectName).
                createExpression(expression);

        final AdviceDefinition adviceDef = new AdviceDefinition(
                adviceName, adviceType, aspectName, aspectClassName,
                expr, method, methodIndex, aspectDef
View Full Code Here

            final String expression,
            final String[] introducedInterfaceNames,
            final Method[] introducedMethods,
            final String deploymentModel,
            final AspectDefinition aspectDef) {
        Expression expr = ExpressionNamespace.getExpressionNamespace(aspectDef.getName()).
                createExpression(expression);

        final IntroductionDefinition introDef = new IntroductionDefinition(
                introductionName, expr, introducedInterfaceNames, introducedMethods, deploymentModel
        );
View Full Code Here

    public static InterfaceIntroductionDefinition createInterfaceIntroductionDefinition(
            final String introductionName,
            final String expression,
            final String interfaceClassName,
            final AspectDefinition aspectDef) {
        Expression expr = ExpressionNamespace.getExpressionNamespace(aspectDef.getName()).
                createExpression(expression);

        final InterfaceIntroductionDefinition introDef = new InterfaceIntroductionDefinition(
                introductionName, expr, interfaceClassName
        );
View Full Code Here

    private ExpressionNamespace space = ExpressionNamespace.getExpressionNamespace();

    public void testBuildSingleAnonymousExpression() {
        try {
            Expression root = ExpressionNamespace.getExpressionNamespace().createExpression(
                    "* test.ExpressionTest.set(..)", PointcutType.EXECUTION
            );
        }
        catch (Exception e) {
            fail(e.toString());
View Full Code Here

            PointcutManager aspect = SystemLoader.getSystem(uuid).getAspectManager().
                    getPointcutManager(aspectDef.getName());

            for (Iterator it2 = aspectDef.getAllAdvices().iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();
                Expression expression = adviceDef.getExpression();

                for (Iterator it3 = expression.getCflowExpressions().entrySet().iterator(); it3.hasNext();) {
                    Map.Entry entry = (Map.Entry)it3.next();
                    Expression value = (Expression)entry.getValue();

                    if (value instanceof ExpressionExpression) {

                        // recursive
                        // TODO ALEX exprexpr using exprexpr
                        // like pc cflow = "a or b"
                        // .. pc exec = "c IN cflow"
                        (new Exception("todo")).printStackTrace();
                    }
                    else {
                        // get the referenced cflow poincut definition
                        PointcutDefinition cflowPointcutDef = aspectDef.getPointcutDef(value.getName());

                        // if null, it is an anonymous cflow like in "execution(..) AND cflow(...)"
                        // create a new PoincutDef lately to bind it
                        // TODO check me - not needed since anonymous are autonamed ?
                        if (cflowPointcutDef == null) {
                            cflowPointcutDef = new PointcutDefinition();
                            cflowPointcutDef.setName(value.getName());
                            cflowPointcutDef.setType(PointcutType.CFLOW);
                            cflowPointcutDef.setExpression(value.getExpression());
                        }

                        // create call pointcut
                        Pointcut pointcut = new Pointcut(uuid, value);
View Full Code Here

        }
    }

    public void testBuildSingleAnonymousHierarchicalExpression() {
        try {
            Expression root = ExpressionNamespace.getExpressionNamespace().createExpression(
                    "* foo.bar.Baz+.set(..)", PointcutType.EXECUTION
            );
        }
        catch (Exception e) {
            fail(e.toString());
View Full Code Here

                    space.createExpression("* test.ExpressionTest.set(..)", "", "pc1", PointcutType.EXECUTION)
            );
            space.registerExpression(
                    space.createExpression("* test.ExpressionTest.get(..)", "", "pc2", PointcutType.EXECUTION)
            );
            Expression root = ExpressionNamespace.getExpressionNamespace().createExpression("pc1&&pc2");
        }
        catch (Exception e) {
            fail(e.toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.definition.expression.Expression

Copyright © 2018 www.massapicom. 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.