Examples of AspectContainer


Examples of org.codehaus.aspectwerkz.aspect.AspectContainer

                    deploymentModel,
                    aspectDef,
                    parameters
            );

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

            // register the aspect in the system
            SystemLoader.getSystem(uuid).getAspectManager().register(
                    container,
View Full Code Here

Examples of org.codehaus.aspectwerkz.aspect.AspectContainer

            cv.visitLabel(switchCaseLabels[0]);

            // add invocations to the before advices
            for (int i = 0; i < beforeAdvices.length; i++) {
                IndexTuple beforeAdvice = beforeAdvices[i];
                AspectContainer container = system.getAspectManager().getAspectContainer(beforeAdvice.getAspectIndex());
                Method adviceMethod = container.getAdvice(beforeAdvice.getMethodIndex());
                String aspectClassName = container.getCrossCuttingInfo().
                        getAspectClass().getName().replace('.', '/');

                String aspectFieldName = BEFORE_ADVICE_FIELD_PREFIX + i;
                String aspectClassSignature = L + aspectClassName + SEMICOLON;

                cv.visitVarInsn(Constants.ALOAD, 0);
                cv.visitFieldInsn(Constants.GETFIELD, className, aspectFieldName, aspectClassSignature);
                cv.visitVarInsn(Constants.ALOAD, 0);
                cv.visitMethodInsn(
                        Constants.INVOKEVIRTUAL, aspectClassName, adviceMethod.getName(),
                        BEFORE_ADVICE_METHOD_SIGNATURE
                );
            }

            // add invocation to this.proceed
            cv.visitVarInsn(Constants.ALOAD, 0);
            cv.visitMethodInsn(Constants.INVOKEVIRTUAL, className, PROCEED_METHOD_NAME, PROCEED_METHOD_SIGNATURE);
            cv.visitVarInsn(Constants.ASTORE, 1);

            // add invocations to the after advices
            for (int i = afterAdvices.length - 1; i >= 0; i--) {
                IndexTuple afterAdvice = afterAdvices[i];
                AspectContainer container = system.getAspectManager().getAspectContainer(afterAdvice.getAspectIndex());
                Method adviceMethod = container.getAdvice(afterAdvice.getMethodIndex());
                String aspectClassName = container.getCrossCuttingInfo().
                        getAspectClass().getName().replace('.', '/');

                String aspectFieldName = AFTER_ADVICE_FIELD_PREFIX + i;
                String aspectClassSignature = L + aspectClassName + SEMICOLON;
View Full Code Here

Examples of org.codehaus.aspectwerkz.aspect.AspectContainer

        if (hasBeforeAfterAdvice) {
            j = 1;
        }
        for (; i < aroundAdvices.length; i++, j++) {
            IndexTuple aroundAdvice = aroundAdvices[i];
            AspectContainer container = system.getAspectManager().getAspectContainer(aroundAdvice.getAspectIndex());
            Method adviceMethod = container.getAdvice(aroundAdvice.getMethodIndex());
            String aspectClassName = container.getCrossCuttingInfo().
                    getAspectClass().getName().replace('.', '/');

            String aspectFieldName = AROUND_ADVICE_FIELD_PREFIX + i;
            String aspectClassSignature = L + aspectClassName + SEMICOLON;
View Full Code Here

Examples of org.codehaus.aspectwerkz.aspect.AspectContainer

     * @param klass the class of the aspect
     * @return the container, put in cache based on aspect class as a key
     */
    public static AspectContainer getContainer(final Class klass) {
        synchronized (ASPECT_CONTAINERS) {
            AspectContainer container = (AspectContainer) ASPECT_CONTAINERS.get(klass);
            if (container == null) {
                container = createAspectContainer(klass);
                //FIXME support for aspect reused accross systems with different params etc
                //by using a lookup by uuid/aspectNickName
                // right now broken since we have 1 container per aspect CLASS while the definition
View Full Code Here

Examples of org.codehaus.aspectwerkz.aspect.AspectContainer

                    aspectDefinition.getName(),
                    aspectDefinition.getDeploymentModel(),
                    aspectDefinition,
                    aspectDefinition.getParameters()
            );
            final AspectContainer container = (AspectContainer) constructor.newInstance(new Object[]{aspectContext});
            aspectContext.setContainer(container);
            return container;
        } catch (InvocationTargetException e) {
            throw new DefinitionException(e.getTargetException().toString());
        } catch (NoSuchMethodException e) {
View Full Code Here

Examples of org.codehaus.aspectwerkz.aspect.AspectContainer

        for (int i = 0; i < aroundAdvice.length; i++) {
            cv.visitLabel(caseLabels[i]);

            // gather advice info
            AdviceInfo adviceInfo = aroundAdvice[i];
            AspectContainer container = adviceInfo.getAspectManager().getAspectContainer(adviceInfo.getAspectIndex());
            Method adviceMethod = container.getAdvice(adviceInfo.getMethodIndex());
            String aspectClassName = container.getCrossCuttingInfo().getAspectClass().getName().replace('.', '/');
            String aspectFieldName = AROUND_ADVICE_FIELD_PREFIX + i;
            String aspectClassSignature = L + aspectClassName + SEMICOLON;

            // get the aspect instance
            cv.visitFieldInsn(GETSTATIC, joinPointClassName, AROUND_ADVICE_FIELD_PREFIX + i, aspectClassSignature);
View Full Code Here

Examples of org.codehaus.aspectwerkz.aspect.AspectContainer

                                                   final int argStartIndex,
                                                   final int joinPointInstanceIndex) {

        for (int i = 0; i < advices.length; i++) {
            AdviceInfo advice = advices[i];
            AspectContainer container = advice.getAspectManager().getAspectContainer(advice.getAspectIndex());
            Method adviceMethod = container.getAdvice(advice.getMethodIndex());
            String aspectClassName = container.getCrossCuttingInfo().getAspectClass().getName().replace('.', '/');
            String aspectFieldName = BEFORE_ADVICE_FIELD_PREFIX + i;
            String aspectClassSignature = L + aspectClassName + SEMICOLON;

            //get the aspect instance
            cv.visitFieldInsn(GETSTATIC, joinPointClassName, aspectFieldName, aspectClassSignature);
View Full Code Here

Examples of org.codehaus.aspectwerkz.aspect.AspectContainer

                                                  final int joinPointInstanceIndex) {

        // add after advice in reverse order
        for (int i = advices.length - 1; i >= 0; i--) {
            AdviceInfo advice = advices[i];
            AspectContainer container = advice.getAspectManager().getAspectContainer(advice.getAspectIndex());
            Method adviceMethod = container.getAdvice(advice.getMethodIndex());
            String aspectClassName = container.getCrossCuttingInfo().getAspectClass().getName().replace('.', '/');
            String aspectFieldName = AFTER_ADVICE_FIELD_PREFIX + i;
            String aspectClassSignature = L + aspectClassName + SEMICOLON;

            // get the aspect instance
            cv.visitFieldInsn(GETSTATIC, joinPointClassName, aspectFieldName, aspectClassSignature);
View Full Code Here

Examples of org.codehaus.aspectwerkz.aspect.AspectContainer

            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.aspect.AspectContainer

     */
    public CrossCuttingInfo[] getCrossCuttingInfos() {
        AspectContainer[] aspectContainers = m_aspectRegistry.getAspectContainers();
        CrossCuttingInfo[] infos = new CrossCuttingInfo[aspectContainers.length];
        for (int i = 0; i < aspectContainers.length; i++) {
            AspectContainer aspectContainer = aspectContainers[i];
            infos[i] = aspectContainer.getCrossCuttingInfo();
        }
        return infos;
    }
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.