Examples of CrossCuttingInfo


Examples of org.codehaus.aspectwerkz.CrossCuttingInfo

            }
            else {
                deploymentModel = DeploymentModel.getDeploymentModelAsInt(aspectDef.getDeploymentModel());
            }

            final CrossCuttingInfo crossCuttingInfoPrototype = new CrossCuttingInfo(
                    uuid,
                    aspectClass,
                    aspectDef.getName(),
                    deploymentModel,
                    aspectDef,
                    parameters
            );

            final AspectContainer container = createAspectContainer(crossCuttingInfoPrototype);
            crossCuttingInfoPrototype.setContainer(container);

            // register the aspect in the system
            SystemLoader.getSystem(uuid).getAspectManager().register(
                    container,
                    new PointcutManager(uuid, aspectDef.getName(), deploymentModel)
View Full Code Here

Examples of org.codehaus.aspectwerkz.CrossCuttingInfo

                                           final ClassWriter cw,
                                           final String aspectFieldName,
                                           final CodeVisitor cv,
                                           final String joinPointClassName) {

        final CrossCuttingInfo info = adviceTuple.getAspectManager().getAspectContainer(adviceTuple.getAspectIndex())
                .getCrossCuttingInfo();
        final String aspectClassName = info.getAspectClass().getName().replace('.', '/');
        final String aspectClassSignature = L + aspectClassName + SEMICOLON;

        // add the aspect field
        cw.visitField(ACC_PRIVATE + ACC_FINAL + ACC_STATIC, aspectFieldName, aspectClassSignature, null, null);

        // retrieve the aspect set it to the field
        cv.visitFieldInsn(GETSTATIC, joinPointClassName, SYSTEM_FIELD_NAME, SYSTEM_CLASS_SIGNATURE);
        cv.visitLdcInsn(info.getUuid());
        cv.visitMethodInsn(INVOKEVIRTUAL,
                SYSTEM_CLASS_NAME,
                GET_ASPECT_MANAGER_METHOD_NAME,
                GET_ASPECT_MANAGER_METHOD_SIGNATURE);
        cv.visitIntInsn(BIPUSH, adviceTuple.getAspectIndex());
        cv.visitMethodInsn(INVOKEVIRTUAL,
                ASPECT_MANAGER_CLASS_NAME,
                GET_ASPECT_CONTAINER_METHOD_NAME,
                GET_ASPECT_CONTAINER_METHOD_SIGNATURE);

        switch (info.getDeploymentModel()) {
            case DeploymentModel.PER_JVM:
                cv.visitMethodInsn(INVOKEINTERFACE,
                        ASPECT_CONTAINER_CLASS_NAME,
                        GET_PER_JVM_ASPECT_METHOD_NAME,
                        GET_PER_JVM_ASPECT_METHOD_SIGNATURE);
                break;
            case DeploymentModel.PER_CLASS:
                cv.visitMethodInsn(INVOKEINTERFACE,
                        ASPECT_CONTAINER_CLASS_NAME,
                        GET_PER_CLASS_ASPECT_METHOD_NAME,
                        GET_PER_CLASS_ASPECT_METHOD_SIGNATURE);
                break;
            default:
                throw new UnsupportedOperationException(
                        "JITGen - unsupported deployment model - " + aspectFieldName + " " + DeploymentModel.getDeploymentModelAsString(
                                info.getDeploymentModel()));
                //return true;
        }

        cv.visitTypeInsn(CHECKCAST, aspectClassName);
        cv.visitFieldInsn(PUTSTATIC, joinPointClassName, aspectFieldName, aspectClassSignature);
View Full Code Here

Examples of org.codehaus.aspectwerkz.CrossCuttingInfo

        aspectDef.setDeploymentModel(DeploymentModel.getDeploymentModelAsString(deploymentModel));

        // parse the class attributes and create a definition
        m_annotationParser.parse(aspectClass, aspectDef, m_definition);
        m_definition.addAspect(aspectDef);
        CrossCuttingInfo crossCuttingInfo = new CrossCuttingInfo(
            null,
            aspectClass,
            aspectDef.getName(),
            deploymentModel,
            aspectDef,
            new HashMap());
        AspectContainer container = StartupManager.createAspectContainer(crossCuttingInfo);
        crossCuttingInfo.setContainer(container);
        m_aspectRegistry.register(container, new PointcutManager(name, deploymentModel));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.CrossCuttingInfo

        final AdviceInfo adviceTuple,
        final ClassWriter cw,
        final String aspectFieldName,
        final CodeVisitor cv,
        final String className) {
        final CrossCuttingInfo info = adviceTuple.getAspectManager().getAspectContainer(adviceTuple.getAspectIndex())
                .getCrossCuttingInfo();
        final String aspectClassName = info.getAspectClass().getName().replace('.', '/');
        final String aspectClassSignature = L + aspectClassName + SEMICOLON;

        // add the aspect field
        cw.visitField(Constants.ACC_PRIVATE, aspectFieldName, aspectClassSignature, null, null);

        // handle the init in the constructor
        cv.visitVarInsn(Constants.ALOAD, 0);
        cv.visitVarInsn(Constants.ALOAD, 0);
        cv.visitFieldInsn(Constants.GETFIELD, className, SYSTEM_FIELD_NAME, SYSTEM_CLASS_SIGNATURE);
        cv.visitLdcInsn(adviceTuple.getAspectManager().getUuid());
        cv.visitMethodInsn(
            Constants.INVOKEVIRTUAL,
            SYSTEM_CLASS_NAME,
            GET_ASPECT_MANAGER_METHOD_NAME,
            GET_ASPECT_MANAGER_METHOD_NAME_SIGNATURE);
        cv.visitIntInsn(Constants.BIPUSH, adviceTuple.getAspectIndex());
        cv.visitMethodInsn(
            Constants.INVOKEVIRTUAL,
            ASPECT_MANAGER_CLASS_NAME,
            GET_ASPECT_CONTAINER_METHOD_NAME,
            GET_ASPECT_METHOD_SIGNATURE);
        switch (info.getDeploymentModel()) {
            case DeploymentModel.PER_JVM:
                cv.visitMethodInsn(
                    Constants.INVOKEINTERFACE,
                    ASPECT_CONTAINER_CLASS_NAME,
                    GET_PER_JVM_ASPECT_METHOD_NAME,
View Full Code Here

Examples of org.codehaus.aspectwerkz.CrossCuttingInfo

            } else {
                deploymentModel = DeploymentModel.getDeploymentModelAsInt(aspectDef.getDeploymentModel());
            }

            //TODO: we could set the WHOLE AspectManager that defines the Aspect instead
            final CrossCuttingInfo crossCuttingInfoPrototype = new CrossCuttingInfo(
                aspectManager.getUuid(),
                aspectClass,
                aspectDef.getName(),
                deploymentModel,
                aspectDef,
                parameters);
            final AspectContainer container = createAspectContainer(crossCuttingInfoPrototype);
            crossCuttingInfoPrototype.setContainer(container);
            PointcutManager pointcutManager = new PointcutManager(aspectDef.getName(), deploymentModel);
            aspectManager.register(container, pointcutManager);
        } catch (Exception e) {
            throw new WrappedRuntimeException(e);
        }
View Full Code Here

Examples of org.codehaus.aspectwerkz.CrossCuttingInfo

            synchronized (m_aspectIndexes) {
                synchronized (m_adviceIndexes) {
                    synchronized (m_mixins) {
                        synchronized (m_pointcutManagerMap) {
                            try {
                                CrossCuttingInfo crossCuttingInfo = aspectContainer.getCrossCuttingInfo();
                                m_pointcutManagerMap.put(crossCuttingInfo.getName(), pointcutManager);
                                final int indexAspect = m_aspectContainers.length + 1;
                                m_aspectIndexes.put(crossCuttingInfo.getName(), indexAspect);
                                final Object[] tmpAspects = new Object[m_aspectContainers.length + 1];
                                java.lang.System.arraycopy(
                                    m_aspectContainers,
                                    0,
                                    tmpAspects,
                                    0,
                                    m_aspectContainers.length);
                                tmpAspects[m_aspectContainers.length] = aspectContainer;
                                m_aspectContainers = new AspectContainer[m_aspectContainers.length + 1];
                                java.lang.System.arraycopy(tmpAspects, 0, m_aspectContainers, 0, tmpAspects.length);

                                // retrieve a sorted advices list => matches the sorted method list
                                // in the
                                // aspectContainer
                                List advices = crossCuttingInfo.getAspectDefinition().getAllAdvices();
                                for (Iterator it = advices.iterator(); it.hasNext();) {
                                    final AdviceDefinition adviceDef = (AdviceDefinition) it.next();
                                    AdviceInfo tuple = new AdviceInfo(
                                        indexAspect,
                                        adviceDef.getMethodIndex(),
                                        m_aspectManager);

                                    //prefix AdviceName with AspectName to allow AspectReuse
                                    m_adviceIndexes.put(crossCuttingInfo.getName() + "/" + adviceDef.getName(), tuple);
                                }

                                // 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,
View Full Code Here

Examples of org.codehaus.aspectwerkz.CrossCuttingInfo

        // parse the class attributes and create a definition
        m_attributeParser.parse(aspectClass, aspectDef, m_definition);
        m_definition.addAspect(aspectDef);

        CrossCuttingInfo crossCuttingInfo = new CrossCuttingInfo(
                null,
                aspectClass,
                aspectDef.getName(),
                deploymentModel,
                aspectDef,
                new HashMap()
        );

        AspectContainer container = StartupManager.createAspectContainer(crossCuttingInfo);
        crossCuttingInfo.setContainer(container);

        m_aspectRegistry.register(container, new PointcutManager(m_uuid, name, deploymentModel));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.CrossCuttingInfo

            }
            else {
                deploymentModel = DeploymentModel.getDeploymentModelAsInt(aspectDef.getDeploymentModel());
            }

            final CrossCuttingInfo crossCuttingInfoPrototype = new CrossCuttingInfo(
                    uuid,
                    aspectClass,
                    aspectDef.getName(),
                    deploymentModel,
                    aspectDef,
                    parameters
            );

            final AspectContainer container = createAspectContainer(crossCuttingInfoPrototype);
            crossCuttingInfoPrototype.setContainer(container);

            // register the aspect in the system
            SystemLoader.getSystem(uuid).getAspectManager().register(
                    container,
                    new PointcutManager(uuid, aspectDef.getName(), deploymentModel)
View Full Code Here

Examples of org.codehaus.aspectwerkz.CrossCuttingInfo

            synchronized (m_aspectIndexes) {
                synchronized (m_adviceIndexes) {
                    synchronized (m_mixins) {
                        synchronized (m_pointcutManagerMap) {
                            try {
                                CrossCuttingInfo crossCuttingInfo = container.getCrossCuttingInfo();

                                m_pointcutManagerMap.put(crossCuttingInfo.getName(), pointcutManager);

                                // aspects
                                final int indexAspect = m_aspectContainers.length + 1;
                                m_aspectIndexes.put(crossCuttingInfo.getName(), indexAspect);

                                final Object[] tmpAspects = new Object[m_aspectContainers.length + 1];
                                java.lang.System.arraycopy(m_aspectContainers, 0, tmpAspects, 0, m_aspectContainers.length);

                                tmpAspects[m_aspectContainers.length] = container;

                                m_aspectContainers = new AspectContainer[m_aspectContainers.length + 1];
                                java.lang.System.arraycopy(tmpAspects, 0, m_aspectContainers, 0, tmpAspects.length);

                                // retrieve a sorted advices list => matches the sorted method list in the container
                                List advices = crossCuttingInfo.getAspectDefinition().getAllAdvices();
                                for (Iterator it = advices.iterator(); it.hasNext();) {
                                    final AdviceDefinition adviceDef = (AdviceDefinition)it.next();
                                    m_adviceIndexes.put(
                                            adviceDef.getName(),
                                            new IndexTuple(indexAspect, adviceDef.getMethodIndex())
                                    );
                                }

                                // mixins
                                List introductions = crossCuttingInfo.getAspectDefinition().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 = crossCuttingInfo.getAspectClass().getClassLoader().loadClass(
                                            introDef.getName()
                                    );
                                    Introduction mixin = new Introduction(
                                            introDef.getName(), defaultImplClass, crossCuttingInfo, introDef
                                    );
View Full Code Here

Examples of org.codehaus.aspectwerkz.CrossCuttingInfo

        final AdviceInfo adviceTuple,
        final ClassWriter cw,
        final String aspectFieldName,
        final CodeVisitor cv,
        final String className) {
        final CrossCuttingInfo info = adviceTuple.getAspectManager().getAspectContainer(adviceTuple.getAspectIndex())
                .getCrossCuttingInfo();
        final String aspectClassName = info.getAspectClass().getName().replace('.', '/');
        final String aspectClassSignature = L + aspectClassName + SEMICOLON;

        // add the aspect field
        cw.visitField(Constants.ACC_PRIVATE, aspectFieldName, aspectClassSignature, null, null);

        // handle the init in the constructor
        cv.visitVarInsn(Constants.ALOAD, 0);
        cv.visitVarInsn(Constants.ALOAD, 0);
        cv.visitFieldInsn(Constants.GETFIELD, className, SYSTEM_FIELD_NAME, SYSTEM_CLASS_SIGNATURE);
        cv.visitLdcInsn(adviceTuple.getAspectManager().getUuid());
        cv.visitMethodInsn(
            Constants.INVOKEVIRTUAL,
            SYSTEM_CLASS_NAME,
            GET_ASPECT_MANAGER_METHOD_NAME,
            GET_ASPECT_MANAGER_METHOD_NAME_SIGNATURE);
        cv.visitIntInsn(Constants.BIPUSH, adviceTuple.getAspectIndex());
        cv.visitMethodInsn(
            Constants.INVOKEVIRTUAL,
            ASPECT_MANAGER_CLASS_NAME,
            GET_ASPECT_CONTAINER_METHOD_NAME,
            GET_ASPECT_METHOD_SIGNATURE);
        switch (info.getDeploymentModel()) {
            case DeploymentModel.PER_JVM:
                cv.visitMethodInsn(
                    Constants.INVOKEINTERFACE,
                    ASPECT_CONTAINER_CLASS_NAME,
                    GET_PER_JVM_ASPECT_METHOD_NAME,
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.