Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Declare parents in concrete aspect?
Declare parents in concrete aspect? [message #596304] Tue, 14 August 2007 10:21
Martin Frey is currently offline Martin Frey
Messages: 2
Registered: July 2009
Junior Member
Hi
to make a long story short i have two aspects. A abstract, B concrete of A.
A defines a general PropertyChangeSupport handler but it should not define
which classes should get woven at loadtime. Thats why the concrete aspect B
is there to define this.
I don't know why this shouldnt work. Since other concrete aspects work
perfectly. Are there some known issues regarding the "declare parents"
functionality?

If i define the declare parents directly in BeanChangeDefinitions all works
as expected. But i want to be able to use this aspect for multiple plugins.
So i dont want to use a concrete aspect to define the within package stuff.

Did someone solve this problem already?

regards Martin


Here's the code of the two aspects.
---------------------------------------------
public abstract aspect BeanChangeDefinitions {
// Add PropertyChangeSupport variable
private PropertyChangeSupport
PropertyChangeNotifier.propertyChangeSupport;

public void
PropertyChangeNotifier.addPropertyChangeListener(PropertyCha ngeListener
listener) {
propertyChangeSupport.addPropertyChangeListener(listener);
}
public void PropertyChangeNotifier.addPropertyChangeListener(String
propertyName, PropertyChangeListener listener) {
propertyChangeSupport.addPropertyChangeListener(propertyName ,
listener);
}
public void
PropertyChangeNotifier.removePropertyChangeListener(Property ChangeListener
listener) {
propertyChangeSupport.removePropertyChangeListener(listener) ;
}
public void PropertyChangeNotifier.removePropertyChangeListener(String
propertyName, PropertyChangeListener listener) {
propertyChangeSupport.removePropertyChangeListener(propertyN ame,listener);
}
public void PropertyChangeNotifier.firePropertyChange(String
propertyName,Object oldValue, Object newValue) {
propertyChangeSupport.firePropertyChange(propertyName,
oldValue,newValue);
}
public void PropertyChangeNotifier.createPropertyChangeSupport() {
propertyChangeSupport = new PropertyChangeSupport(this);
}

private pointcut createBean() : execution(new(..)) && withinBean();
private pointcut propertyChange() : set(* *) && !set(static * *) &&
withinBean();
public abstract pointcut withinBean();
after() : propertyChange() {
String sigName = thisJoinPoint.getSignature().getName();
Object newValue = thisJoinPoint.getArgs()[0];
PropertyChangeNotifier bean = (PropertyChangeNotifier)
thisJoinPoint.getThis();
bean.firePropertyChange(sigName, "", newValue);
}
after() : createBean() {
PropertyChangeNotifier bean = (PropertyChangeNotifier)
thisJoinPoint.getThis();
bean.createPropertyChangeSupport();
}
}
---------------------------------------------

public aspect ConcreteBeanChangeDefinitions extends BeanChangeDefinitions {
declare parents : models.* implements PropertyChangeNotifier;
public pointcut withinBean() : within(models.*);
}
Previous Topic:Another internal NPE
Next Topic:Declare parents in concrete aspect?
Goto Forum:
  


Current Time: Fri Jul 25 05:18:07 EDT 2014

Powered by FUDForum. Page generated in 0.01496 seconds