Package org.codehaus.aspectwerkz.attribdef.definition

Examples of org.codehaus.aspectwerkz.attribdef.definition.IntroductionDefinition


        AspectWerkzDefinitionImpl def = (AspectWerkzDefinitionImpl)definition;

        List introductionDefs = def.getIntroductionDefinitions(classMetaData);
        boolean isClassAdvised = false;
        for (Iterator it = introductionDefs.iterator(); it.hasNext();) {
            IntroductionDefinition introDef = (IntroductionDefinition) it.next();
            int methodIndex = 0;
            for (Iterator mit = introDef.getMethodIntroductions().iterator(); mit.hasNext(); methodIndex++) {
                int mixinIndex = def.getMixinIndexByName(introDef.getName());
                isClassAdvised = true;
                //TODO any use case for a method already implemented ?
                transformer.createProxyMethod(
                        cg,
                        cpg,
View Full Code Here


     */
    public void swapImplementation(final Class newImplementationClass) {
        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");
            }
        }

View Full Code Here

                                                          final String introductionName,
                                                          final String[] introducedInterfaceNames,
                                                          final Method[] introducedMethods,
                                                          final String deploymentModel,
                                                          final AspectDefinition aspectDef) {
        IntroductionDefinition introDef = createIntroductionDefinition(
                introductionName,
                expression,
                introducedInterfaceNames,
                introducedMethods,
                deploymentModel,
View Full Code Here

                                                                  final String deploymentModel,
                                                                  final AspectDefinition aspectDef) {
        Expression expr = Expression.createRootExpression(
                aspectDef.getName(), expression, PointcutType.CLASS
        );
        final IntroductionDefinition introDef = new IntroductionDefinition(
                introductionName, expr, introducedInterfaceNames, introducedMethods, deploymentModel
        );
        return introDef;
    }
View Full Code Here

                                    );
                                }

                                List introductions = aspect.___AW_getAspectDef().getIntroductions();
                                for (Iterator it = introductions.iterator(); it.hasNext(); ) {
                                    IntroductionDefinition introDef = (IntroductionDefinition) it.next();
                                    // load default mixin impl from the aspect which defines it
                                    Class defaultImplClass = aspect.getClass().getClassLoader().loadClass(introDef.getName());
                                    Introduction mixin = new Introduction(introDef.getName(), defaultImplClass, aspect, introDef);
                                    // prepare the container
                                    DefaultIntroductionContainerStrategy introContainer = new DefaultIntroductionContainerStrategy(mixin, aspect.___AW_getContainer());
                                    mixin.setContainer(introContainer);
                                    final Mixin[] tmpMixins = new Mixin[m_mixins.length + 1];
                                    java.lang.System.arraycopy(m_mixins, 0, tmpMixins, 0, m_mixins.length);
View Full Code Here

                                    );
                                }

                                List introductions = aspect.___AW_getAspectDef().getIntroductions();
                                for (Iterator it = introductions.iterator(); it.hasNext(); ) {
                                    IntroductionDefinition introDef = (IntroductionDefinition) it.next();
                                    // load default mixin impl from the aspect which defines it
                                    Class defaultImplClass = aspect.getClass().getClassLoader().loadClass(introDef.getName());
                                    Introduction mixin = new Introduction(introDef.getName(), defaultImplClass, aspect, introDef);
                                    // prepare the container
                                    DefaultIntroductionContainerStrategy introContainer = new DefaultIntroductionContainerStrategy(mixin, aspect.___AW_getContainer());
                                    mixin.setContainer(introContainer);
                                    final Mixin[] tmpMixins = new Mixin[m_mixins.length + 1];
                                    java.lang.System.arraycopy(m_mixins, 0, tmpMixins, 0, m_mixins.length);
View Full Code Here

        AspectWerkzDefinitionImpl def = (AspectWerkzDefinitionImpl)definition;

        List introductionDefs = def.getIntroductionDefinitions(classMetaData);
        boolean isClassAdvised = false;
        for (Iterator it = introductionDefs.iterator(); it.hasNext();) {
            IntroductionDefinition introDef = (IntroductionDefinition) it.next();
            int methodIndex = 0;
            for (Iterator mit = introDef.getMethodIntroductions().iterator(); mit.hasNext(); methodIndex++) {
                int mixinIndex = def.getMixinIndexByName(introDef.getName());
                isClassAdvised = true;
                //TODO any use case for a method already implemented ?
                transformer.createProxyMethod(
                        cg,
                        cpg,
View Full Code Here

                                                          final String introductionName,
                                                          final String[] introducedInterfaceNames,
                                                          final Method[] introducedMethods,
                                                          final String deploymentModel,
                                                          final AspectDefinition aspectDef) {
        IntroductionDefinition introDef = createIntroductionDefinition(
                introductionName,
                expression,
                introducedInterfaceNames,
                introducedMethods,
                deploymentModel,
View Full Code Here

        Expression expr = ExpressionNamespace.getExpressionNamespace(aspectDef.getName()).createExpression(
                expression, PointcutType.CLASS);
//        Expression expr = Expression.createRootExpression(
//                aspectDef.getName(), expression, PointcutType.CLASS
//        );
        final IntroductionDefinition introDef = new IntroductionDefinition(
                introductionName, expr, introducedInterfaceNames, introducedMethods, deploymentModel
        );
        return introDef;
    }
View Full Code Here

     */
    public void swapImplementation(final Class newImplementationClass) {
        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");
            }
        }

View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.attribdef.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.