RE: [aspectwerkz-user] Pointcut issue

[email protected]
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <4D6D27333868D611BD190002B3A6E4EB107724DE@ROSEEXCHMB>
For whatever reason, the attachment doesn't work. I manually embedded the
code inside the email. Please copy it to any java IDE. Thanks a lot for the
help.

// code begins

package examples.annotation;

import org.codehaus.aspectwerkz.joinpoint.StaticJoinPoint;

/**
 * @author <a href="mailto:[email protected]">Alexandre Vasseur</a>
 */
public class Target {

	/**
	 * @DoNotAdvise
	 * @param args
	 * @throws Throwable
	 */
    public static void main(String args[]) throws Throwable {
        System.out.println("examples.annotation.Target.main");
        Target me = new Target();
        me.targetAB();
        me.targetA();
        me.target();
    }

    /**
     * @examples.annotation.AnnotationA(some)
     * @examples.annotation.AnnotationB
     */
    public void targetAB() {
        System.out.println("Target.target AB ");
    }

    /**
     * @DoNotAdvise
     */
    public void targetA() {
        System.out.println("Target.target A");
    }

    public void target() {
        System.out.println("Target.target");
    }

    public static class AnnotationMatchAspect {

		/**
		 * @Around execution(* examples.annotation.Target.*(..)) AND
!execution(@DoNotAdvise * examples.annotation.Target.*(..))
		 */
		public Object aroundB(StaticJoinPoint jp) throws Throwable {
	
System.out.println("Target$AnnotationMatchAspect.beforeB");
		  Object result = jp.proceed(); 
		  if (result != null) {
			  System.err.println(result.toString());
		  }
		  return result;
		}

        /**
         * @Before execution(@DoNotAdvise *
examples.annotation.Target.*(..))  
         */ 
        public void beforeA() {
        }


    }

}

// code ends


-----Original Message-----
From: Jonas Bonér [mailto:[email protected]] 
Sent: Tuesday, March 22, 2005 1:30 PM
To: [email protected]
Subject: Re: [aspectwerkz-user] Pointcut issue

no attachement


On Tue, 22 Mar 2005 13:26:20 -0500, [email protected] <[email protected]>
wrote:
> 
> All,
> 
> Attached is an example downloaded from aspectwerkz website with slight
> modification.
> 
> The code defines two advices aroundB and beforeA, it works as expected.
But
> If I remove method beforeA, it doesn't work anymore (methods in class
Target
> won't be weaved). I think this is a bug of aspectwerks 2.0 final. can
> anybody shed some light?
> 
> Thanks
> Leon
> 
> -----------------------------------------
> This message and any attachments are intended only for the use of the
> addressee and may contain information that is privileged and confidential.
> If the reader of the message is not the intended recipient or an
authorized
> representative of the intended recipient, you are hereby notified that any
> dissemination of this communication is strictly prohibited. If you have
> received this communication in error, notify the sender immediately by
> return email and delete the message and any attachments from your system.
> 
> 


-- 
/Jonas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.