Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Equinox Aspects LTW: capturing aspect instantiation

Hi Martin,
   I guess the one you mentioned is the problem (no idea how to check it though ;)). I've defined a "real" aspect in my aop.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd">
<aspectj>
    <aspects>
<!-- SWT Thread Safety
<concrete-aspect name="it.uniba.di.cdg.jtalk.aspects.SWTThreadingAspect" 
extends="it.uniba.di.cdg.penelope.ui.swt.AbstractSWTThreadingAspect">
<pointcut name="scope" _expression_="within( it.uniba.di.cdg.jtalk.ui..* )"/>
</concrete-aspect>
-->
<aspect name="it.uniba.di.cdg.jtalk.aspects.SWTThreadingAspect" />

     <!-- Aspect Injector -->
     <concrete-aspect name="it.uniba.di.cdg.jtalk.aspects.AspectInjectionAspect" 
     extends="it.uniba.di.cdg.penelope.AbstractAspectInjectionAspect">
     <pointcut name="scope" _expression_="within( it.uniba.di.cdg.jtalk.aspects.SWTThreadingAspect )"/>
</concrete-aspect>
    </aspects>
</aspectj>

The aspect is just:

package it.uniba.di.cdg.jtalk.aspects;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

import it.uniba.di.cdg.penelope.ui.swt.AbstractSWTThreadingAspect;

@Aspect
public class SWTThreadingAspect extends AbstractSWTThreadingAspect {
@Override
@Pointcut( "within( it.uniba.di.cdg.jtalk.ui..* )" )
public void scope() {}
}

In this way, SWTThreadingAspect's instantiation is correctly catched by the synthetic AspectInjectionAspect.

The good thing is that I can dependency inject aspects in this way; the bad one is that I must define "dummy" aspect classes (plus the aop.xml entry) in order to do in code what I may archieve just within the aop.xml file.

Cheers,
Mario

On Mon, Nov 30, 2009 at 11:55 AM, Martin Lippert <lippert@xxxxxxx> wrote:
Hi Mario,

I am not sure but I think this could be a general LTW problem. I assume the concrete aspects from aop.xml are not passed to the weaver for weaving before defined in the VM, correct?

Crossposting to aspectj-dev for discussing the implementation details of this setting...

Cheers,
-Martin

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



--
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan

Back to the top