Package org.codehaus.aspectwerkz.aspect

Examples of org.codehaus.aspectwerkz.aspect.AspectContainer


        m_definition.addAspect(aspectDef);

        prototype.___AW_setDeploymentModel(deploymentModel);
        prototype.___AW_setName(name);
        prototype.___AW_setAspectClass(prototype.getClass());
        prototype.___AW_setContainer(new AspectContainer(prototype));
        prototype.___AW_setAspectDef(aspectDef);

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


     * @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

                    aspectDefinition.getName(),
                    DeploymentModel.getDeploymentModelAsInt(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

                    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

            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

     */
    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

     *
     * @param index the index of the aspect
     * @return the aspect container
     */
    public AspectContainer getAspectContainer(final int index) {
        AspectContainer aspect;
        try {
            aspect = m_aspectContainers[index - 1];
        } catch (Throwable e) {
            initialize();
            try {
View Full Code Here

     *
     * @param name the name of the aspect
     * @return the the aspect container
     */
    public AspectContainer getAspectContainer(final String name) {
        AspectContainer container;
        try {
            container = m_aspectContainers[m_aspectIndexes.get(name) - 1];
        } catch (Throwable e1) {
            initialize();
            try {
View Full Code Here

                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

                }
            } else {
                m_currentAdviceIndex++;
                try {
                    AdviceInfo index = m_adviceIndexes[m_currentAdviceIndex];
                    AspectContainer container = index.getAspectManager().getAspectContainer(index.getAspectIndex());
                    result = container.invokeAdvice(index.getMethodIndex(), joinPoint, index.getMethodToArgIndexes());
                } finally {
                    m_currentAdviceIndex--;
                }
            }
            if (m_stackIndex == 0) {
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.aspect.AspectContainer

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.