Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsNewbiew question: subclassing an aspect belonging to another package
https://www.eclipse.org/forums/index.php/mv/msg/18061/57830/#msg_57830
I'm writing an RCP application and I intend to use aspects to perform some
common tasks among my application views. The one I'm working on now is
ensuring the thread safety in SWT calls ala [1].
I've implemented a generic SwtThreadSafety aspect with some abstract
pointcuts (to be implemented by specific clients). The first clients for
this aspect are a bunch of application views with receive events and need
to update the UI. So far so good: the right join points are captured and
all works ok.
I want the generic SwtThreadSafety aspect to be part of "ui" java package
while the views (and their ad-hoc aspect) belong to the "ui.views" package.
==== Generic aspect ====
package core.ui;
import org.eclipse.ui.PlatformUI;
public abstract aspect SwtThreadSafety {
// Abstract pointcuts and a few around advices
}
==== Views aspect ====
package ui.views;
// Note that this import is marked as "cannot be resolved" :|
import core.ui.SwtThreadSafety;
public aspect ViewsThreadSafety extends SwtThreadSafety {
// Pointcuts definitition
}
The import is not resolved and SwtThreadSafety is not recognized as a type.
Both files are named with the .aj extension.
If I put both of them in the same package, all works ok.
[Sorry for the dumb question] Where am I wrong? :S
Regards
Mario
[1] Swing thread safery aspect from AspectJ in action, chap. 9]]>Mario Scalas2005-10-22T20:57:01-00:00Re: Newbiew question: subclassing an aspect belonging to another package
https://www.eclipse.org/forums/index.php/mv/msg/18061/590613/#msg_590613
1.3.0 snapshot (fetched via update manager).
Mario]]>Mario Scalas2005-10-22T21:57:37-00:00Re: Newbiew question: subclassing an aspect belonging to another package
https://www.eclipse.org/forums/index.php/mv/msg/18061/57855/#msg_57855
1.3.0 snapshot (fetched via update manager).
Mario]]>Mario Scalas2005-10-22T21:57:37-00:00Re: Newbiew question: subclassing an aspect belonging to another package
https://www.eclipse.org/forums/index.php/mv/msg/18061/57879/#msg_57879
public abstract aspect SwtThreadSafety {
abstract pointcut uiMethodCalls();
// other pointcuts and advices
}
Declaring them "protected" fixed the problem.
public abstract aspect SwtThreadSafety {
protected abstract pointcut uiMethodCalls();
// other pointcuts and advices
}
Now I can declare abastract aspects in a package and create implementers in
other packages (keeping the "protected" visibility, of course).
Don't know if it is some kind of a bug or a feature, though :S (I can
replicate everywhere this behaviour).
Hope this will save some time to other people :)
Regards
Mario]]>Mario Scalas2005-10-23T14:35:16-00:00Re: Newbiew question: subclassing an aspect belonging to another package
https://www.eclipse.org/forums/index.php/mv/msg/18061/590632/#msg_590632
public abstract aspect SwtThreadSafety {
abstract pointcut uiMethodCalls();
// other pointcuts and advices
}
Declaring them "protected" fixed the problem.
public abstract aspect SwtThreadSafety {
protected abstract pointcut uiMethodCalls();
// other pointcuts and advices
}
Now I can declare abastract aspects in a package and create implementers in
other packages (keeping the "protected" visibility, of course).
Don't know if it is some kind of a bug or a feature, though :S (I can
replicate everywhere this behaviour).