Package org.codehaus.aspectwerkz.definition

Examples of org.codehaus.aspectwerkz.definition.IntroductionDefinition


        if (newImplementationClass == null) {
            throw new IllegalArgumentException("new implementation class class can not be null");
        }

        // check compatibility
        IntroductionDefinition def = m_prototype.getIntroductionDefinition();
        for (Iterator intfs = def.getInterfaceClassNames().iterator(); intfs.hasNext();) {
            if (!findInterfaceInHierarchy(newImplementationClass, (String)intfs.next())) {
                throw new DefinitionException("new implementation class is not compatible");
            }
        }
        synchronized (this) {
View Full Code Here


                isClassAdvised = true;
            }
        }
        List introDefs = definition.getIntroductionDefinitions(ctx);
        for (Iterator it = introDefs.iterator(); it.hasNext();) {
            IntroductionDefinition introductionDef = (IntroductionDefinition)it.next();
            List interfaceClassNames = introductionDef.getInterfaceClassNames();
            if (addInterfaces(interfaceClassNames, cg)) {
                isClassAdvised = true;
            }
        }
        if (isClassAdvised) {
View Full Code Here

            final ExpressionContext ctx, final CtClass ctClass,
            final AddImplementationTransformer transformer) {
        List introductionDefs = definition.getIntroductionDefinitions(ctx);
        boolean isClassAdvised = false;
        for (Iterator it = introductionDefs.iterator(); it.hasNext();) {
            IntroductionDefinition introDef = (IntroductionDefinition)it.next();
            int methodIndex = 0;
            List methodsToIntroduce = introDef.getMethodsToIntroduce();
            for (Iterator mit = methodsToIntroduce.iterator(); mit.hasNext(); methodIndex++) {
                MethodInfo methodToIntroduce = (MethodInfo)mit.next();
                if (methodToIntroduce == null) {
                    continue;
                }
                transformer.createProxyMethod(
                        ctClass, methodToIntroduce,
                        definition.getMixinIndexByName(introDef.getName()), methodIndex,
                        definition, context
                );
                isClassAdvised = true;
            }
        }
View Full Code Here

        if (newImplementationClass == null) {
            throw new IllegalArgumentException("new implementation class class can not be null");
        }

        // check compatibility
        IntroductionDefinition def = m_prototype.getIntroductionDefinition();
        for (Iterator intfs = def.getInterfaceClassNames().iterator(); intfs.hasNext();) {
            if (!findInterfaceInHierarchy(newImplementationClass, (String) intfs.next())) {
                throw new DefinitionException("new implementation class is not compatible");
            }
        }
        synchronized (this) {
View Full Code Here

                                }

                                // mixins
                                List introductions = crossCuttingInfo.getAspectDefinition().getIntroductions();
                                for (Iterator it = introductions.iterator(); it.hasNext();) {
                                    IntroductionDefinition introDef = (IntroductionDefinition)it.next();

                                    // load default mixinPrototype impl from the aspect which defines it
                                    Class defaultImplClass = crossCuttingInfo.getAspectClass().getClassLoader()
                                            .loadClass(introDef.getName());
                                    Introduction mixinPrototype = new Introduction(
                                            introDef.getName(),
                                            defaultImplClass, crossCuttingInfo,
                                            introDef
                                    );
                                    IntroductionContainer introductionContainer = new IntroductionContainer(
                                            mixinPrototype,
                                            aspectContainer
                                    );
                                    aspectContainer.addIntroductionContainer(
                                            introDef.getName(), introductionContainer
                                    );

                                    // prepare the aspectContainer
                                    mixinPrototype.setContainer(introductionContainer);
                                    final Mixin[] tmpMixins = new Mixin[m_mixins.length + 1];
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.definition.IntroductionDefinition

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.