Re: [aspectwerkz-dev] introducing mixins by annotation.

christoph sturm <chrisml-Ws/[email protected]>
Newsgroups gmane.comp.java.aspectwerkz.devel
Message-ID <[email protected]>
hey!

still doesnt work for me. is there a testcase in cvs that i can look at?

regards
  chris

On Wed, 30 Jun 2004 14:59:50 +0100, Jonas Boner <[email protected]> wrote:
 > This works in HEAD now.
 >
 > Matching on annotated methods, fields and classes have been impl and
 > tested now.
 >
 > /Jonas
 >
 >
 >
 >
 > > -----Original Message-----
 > > From: christoph sturm [mailto:chrisml-Ws/[email protected]]
 > > Sent: Tuesday, June 29, 2004 2:43 PM
 > > To: [email protected]
 > > Subject: Re: [aspectwerkz-dev] introducing mixins by annotation.
 > >
 > > hey jonas!
 > >
 > > i hope i did everything right, but it still doesnt work.
 > >
 > > this is the aspect:
 > > /**
 > >   * @Aspect perInstance
 > >   */
 > > public class IdentifyableAspect
 > > {
 > >      /**
 > >       * @Implements within(@Identity *..*)
 > >       */
 > >      public class IdentifyableImpl implements Identifyable
 > >      {
 > >          long id;
 > >      }
 > > }
 > >
 > > this is the test class:
 > > /**
 > >   * @Identity
 > >   */
 > > public class IdentifyableClass
 > > {
 > >
 > > }
 > >
 > > this fails:
 > > public class IdentifyableAspectTest extends TestCase {
 > >      public void testRecognizesIdentifyAbleClasses()
 > >      {
 > >          IdentifyableClass identifyableClass = new
 > > IdentifyableClass();
 > >          assertTrue(identifyableClass instanceof Identifyable);
 > >
 > >      }
 > >
 > > }
 > >
 > > AW picks up the aspect at startup:
 > > ******************************************************************
 > > * ClassLoader = [email protected]
 > > * SystemID = main
 > > * Aspect total count = 1
 > > * src/main/aspectwerkz.xml
 > > ******************************************************************
 > >
 > > or is it a problem with the systemID? what systemid should i
 > > specify in my definition file?
 > >
 > > regards
 > >   chris
 > >
 > >
 > > On Tue, 29 Jun 2004 13:44:21 +0100, Jonas Boner
 > > <[email protected]> wrote:
 > >  >
 > >  > Hi Chris.
 > >  >
 > >  > You should write it like this:
 > >  >
 > >  > @Implements within(@Identity *..*)
 > >  >
 > >  > I can't garantuee you that it will work though since this
 > > is something  > that we have not tested yet.
 > >  > Please get back to me if it works/not works.
 > >  >
 > >  > I'll update the docs with this later.
 > >  > Thanks.
 > >  >
 > >  > /Jonas
 > >  >
 > >  >
 > >  >
 > >  > > -----Original Message-----
 > >  > > From: christoph sturm [mailto:chrisml-Ws/[email protected]]  >
 > > > Sent: Tuesday, June 29, 2004 12:58 PM  > > To:
 > > [email protected]  > > Subject: [aspectwerkz-dev]
 > > introducing mixins by annotation.
 > >  > >
 > >  > > Hi!
 > >  > >
 > >  > > I am using aspectwerkz3 cvs, and i want to mixin an
 > > interface  > > when a class has an annotation.
 > >  > >
 > >  > > the class looks like this:
 > >  > > /**
 > >  > >   * @Identity
 > >  > >   */
 > >  > > public class IdentifyableClass
 > >  > > {
 > >  > >
 > >  > > }
 > >  > >
 > >  > > i have identity defined as custom annotation, and now i
 > > want  > > my aspect to mixin an interface, but i dont know
 > > how to define it.
 > >  > >
 > >  > > this is my test-aspect:
 > >  > > /**
 > >  > >   * @Aspect perInstance
 > >  > >   */
 > >  > > public class IdentifyableAspect
 > >  > > {
 > >  > >      /**
 > >  > >       * @Implements @Identity  <== i dont know what exactly
 > >  > > to write here
 > >  > >       */
 > >  > >      public class IdentifyableImpl implements Identifyable
 > >  > >      {
 > >  > >          long id;
 > >  > >      }
 > >  > > }
 > >  > >
 > >  > > sorry if this is documented somewhere, but i found  > >
 > > annotations only used for advices in the docs.
 > >  > >
 > >  > > regards
 > >  > >   chris
 > >  > >
 > >  >
 > >
 > >
 >
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.