Package org.codehaus.aspectwerkz.definition

Examples of org.codehaus.aspectwerkz.definition.SystemDefinition




        for (Iterator iterator = systemDefinitions.iterator(); iterator.hasNext();) {

            SystemDefinition systemDefinition = (SystemDefinition) iterator.next();

            Collection aspects = systemDefinition.getAspectDefinitions();

            for (Iterator iterator1 = aspects.iterator(); iterator1.hasNext();) {

                AspectDefinition aspectDefinition = (AspectDefinition) iterator1.next();
View Full Code Here


            throw new IllegalArgumentException("class to parse can not be null");
        }
        if (classInfo == null) {
            throw new IllegalArgumentException("class can not be null");
        }
        final SystemDefinition systemDef = mixinDef.getSystemDefinition();
        final List annotations = AsmAnnotations.getAnnotations(AnnotationConstants.MIXIN, classInfo);
        for (Iterator iterator = annotations.iterator(); iterator.hasNext();) {
            Mixin annotation = (Mixin) iterator.next();
            if (annotation != null) {
                String expression = AspectAnnotationParser.getExpressionElseValue(
                        annotation.value(), annotation.pointcut()
                );
                final ExpressionInfo expressionInfo = new ExpressionInfo(expression, systemDef.getUuid());
                ExpressionNamespace.getNamespace(systemDef.getUuid()).addExpressionInfo(
                        DefinitionParserHelper.EXPRESSION_PREFIX + expression.hashCode(),
                        expressionInfo
                );
                mixinDef.addExpressionInfo(expressionInfo);
                mixinDef.setTransient(annotation.isTransient());
View Full Code Here

        System.out.println("-----------------------------------------------------------------------------------");
        System.out.println("---- deploy/undeploy using explicit prepared pointcut ----");
        System.out.println("-----------------------------------------------------------------------------------");

        run();
        SystemDefinition def = SystemDefinitionContainer.getDefinitionFor(
                Thread.currentThread().getContextClassLoader(), "samples"
        );
        DeploymentScope deploymentScope = def.getDeploymentScope("prepareMethodsToLog");

        Deployer.deploy(LoggingAspect.class, deploymentScope);
        run();
        Deployer.undeploy(LoggingAspect.class);
        run();
View Full Code Here

        deployUndeployUsingPreparedPointcut();
        assertEquals("deployUndeployUsingPreparedPointcut ", s_logString);
        s_logString = "";

        SystemDefinition def = SystemDefinitionContainer.getDefinitionFor(
                Thread.currentThread().getContextClassLoader(), "tests"
        );
        DeploymentScope deploymentScope = def.getDeploymentScope("deployUndeployUsingPreparedPointcut");

        Deployer.deploy(AnnDefAspect.class, deploymentScope);

        deployUndeployUsingPreparedPointcut();
        assertEquals("before deployUndeployUsingPreparedPointcut after ", s_logString);
View Full Code Here

        deployUndeployUsingHandle();
        assertEquals("deployUndeployUsingHandle ", s_logString);
        s_logString = "";

        SystemDefinition def = SystemDefinitionContainer.getDefinitionFor(
                Thread.currentThread().getContextClassLoader(), "tests"
        );
        DeploymentScope deploymentScope = def.getDeploymentScope("deployUndeployUsingHandle");
        DeploymentHandle handle = Deployer.deploy(AnnDefAspect.class, deploymentScope);

        deployUndeployUsingHandle();
        assertEquals("before deployUndeployUsingHandle after ", s_logString);
        s_logString = "";
View Full Code Here

        deployUndeployUsingXmlDef();
        assertEquals("deployUndeployUsingXmlDef ", s_logString);
        s_logString = "";

        SystemDefinition def = SystemDefinitionContainer.getDefinitionFor(
                Thread.currentThread().getContextClassLoader(), "tests"
        );
        DeploymentScope deploymentScope = def.getDeploymentScope("deployUndeployUsingXmlDef");

        String aspectXmlDef =
                "<aspect class=\"test.deployment.XmlDefAspect\">" +
                "<pointcut name=\"pc\" expression=\"execution(void test.deployment.DeployerTest.deployUndeployUsingXmlDef())\"/>" +
                "<advice name=\"advice\" type=\"around\" bind-to=\"pc\"/>" +
View Full Code Here

        final DeploymentHandle deploymentHandle = new DeploymentHandle(aspectClass, deployLoader);

        final ClassInfo aspectClassInfo = JavaClassInfo.getClassInfo(aspectClass);

        // create a new aspect def and fill it up with the annotation def from the aspect class
        final SystemDefinition systemDef = SystemDefinitionContainer.getVirtualDefinitionAt(deployLoader);
        final AspectDefinition newAspectDef = new AspectDefinition(className, aspectClassInfo, systemDef);
        final Set newExpressions = getNewExpressionsForAspect(
                aspectClass, newAspectDef, systemDef, deploymentScope, deploymentHandle
        );
View Full Code Here

        final String className = aspect.getName();
        logDeployment(className, deployLoader);

        final DeploymentHandle deploymentHandle = new DeploymentHandle(aspect, deployLoader);

        final SystemDefinition systemDef = SystemDefinitionContainer.getVirtualDefinitionAt(deployLoader);
        try {
            final Document document = XmlParser.createDocument(xmlDef);
            final AspectDefinition newAspectDef = DocumentParser.parseAspectDefinition(document, systemDef, aspect);
            final Set newExpressions = getNewExpressionsForAspect(
                    aspect, newAspectDef, systemDef, deploymentScope, deploymentHandle
View Full Code Here

        // lookup only in the given classloader scope
        // since the system hierarchy holds reference, they will see the change
        Set systemDefs = SystemDefinitionContainer.getDefinitionsAt(loader);

        for (Iterator it = systemDefs.iterator(); it.hasNext();) {
            SystemDefinition systemDef = (SystemDefinition) it.next();
            final AspectDefinition aspectDef = systemDef.getAspectDefinition(className);
            if (aspectDef != null) {

                final Set newExpressions = new HashSet();
                for (Iterator it2 = aspectDef.getAdviceDefinitions().iterator(); it2.hasNext();) {
                    AdviceDefinition adviceDef = (AdviceDefinition) it2.next();
View Full Code Here

        }

        // add new ones
        final Set systemDefinitions = m_ctx.getDefinitions();
        for (Iterator it = systemDefinitions.iterator(); it.hasNext();) {
            SystemDefinition systemDefinition = (SystemDefinition) it.next();
            final List interfaceIntroDefs = systemDefinition.getInterfaceIntroductionDefinitions(ctx);
            for (Iterator it2 = interfaceIntroDefs.iterator(); it2.hasNext();) {
                final InterfaceIntroductionDefinition interfaceIntroDef = (InterfaceIntroductionDefinition) it2.next();
                interfacesToAdd.addAll(interfaceIntroDef.getInterfaceClassNames());
            }
            final List mixinDefinitions = systemDefinition.getMixinDefinitions(ctx);
            for (Iterator it2 = mixinDefinitions.iterator(); it2.hasNext();) {
                final MixinDefinition mixinDef = (MixinDefinition) it2.next();
                if (ADVISABLE_MIXIN_IMPL_NAME.equals(mixinDef.getMixinImpl().getName())) {
                    // mark it as made advisable
                    m_ctx.markMadeAdvisable();
View Full Code Here

TOP

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

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.