Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ and Eclipse RCP

Hey Dominic,

I guess you are using the Equinox weaving feature to weave your aspects into your RCP application, right?
Or is this limited to the scope of the bundle that the aspect lives in?

Maybe you can point me to a sample project that reproduces this behavior. Would love to take a more detailed look.

Cheers,
-Martin



> 
> Users;
> 
> I'm trying to use AspectJ with an Eclipse RCP program.  I want to use aspects for the normal things, i.e. authorization and logging.
> 
> My failures seem to fall into 2 broad types: crash and burn or don't do anything.
> 
> My first try aspect looks like this:
> 
> Public aspect MyAspect
> {
>    pointcut mypointcut: call(* *.myMethod());
> 
>    before(): mypointcut()
>    {
>        System.out.println("Hello Aspect oriented programming");
>    }
> }
> 
> I have extensive logging turned on, but am not really sure what I'm looking for.
> I get this: info register aspect <MyAspect>
> I also get this: info weaving bundle '<my bundle>' with a bunch of stuff in between.
> I even get: debug weaving '<MyService>'
> 
> MyService registers with OSGi Declarative Services, and is injected into the RCP object, but when I call myMethod on MyService the aspect isn't called.
> 
> On the other hand, when I set up an aspect like this:
> Public aspect MyAspect
> {
>    pointcut mypointcut: call(* *.myMethod());
> 
>    before(): mypointcut()
>    {
>        System.out.println("Hello Aspect oriented programming");
>    }
> }
> 
> The RCP code freaks out, and doesn't run.
> 
> All the debug type output from AspectJ suggests that the AspectJ runtime is loaded and running.
> 
> BTW, where I eventually plan to go with this is to tie it to a Runtime Annotation, as follows:
> Public aspect MyAspect
> {
>    pointcut mypointcut: call(@MyAnnotation * *());
> 
>    before(): mypointcut()
>    {
>        System.out.println("Hello Aspect oriented programming");
>    }
> }
> 
> But this too generates no aspect output.
> 
> Any thoughts?
> 
> Thank you,
> 
> Dominic L. Hilsbos, MBA, CSDA 
> Director - Information Technology 
> Perform Air International Inc.
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top