java - AspectJ example "BeanClassName.MethodName" what does it mean -
java - AspectJ example "BeanClassName.MethodName" what does it mean -
i new aop, , understanding doing sample programme of sts while analyzing code found line this.
private propertychangesupport point.support = new propertychangesupport(this);
here line means point.support, when place pointer on back upwards showing.
propertychangesupport bean.boundpoint.point.support()
here point bean class , not have support() method. need help understanding concept
here finish aspectj class reference;
package bean; import java.beans.*; import java.io.serializable; /* * add together bound properties , serialization point objects */ aspect boundpoint { /* * privately introduce field point hold property * alter back upwards object. `this' reference point object. */ private propertychangesupport point.support = new propertychangesupport(this); /* * introduce property alter registration methods point. * introduce implementation of serializable interface. */ public void point.addpropertychangelistener(propertychangelistener listener){ support.addpropertychangelistener(listener); } public void point.addpropertychangelistener(string propertyname, propertychangelistener listener){ support.addpropertychangelistener(propertyname, listener); } public void point.removepropertychangelistener(string propertyname, propertychangelistener listener) { support.removepropertychangelistener(propertyname, listener); } public void point.removepropertychangelistener(propertychangelistener listener) { support.removepropertychangelistener(listener); } public void point.haslisteners(string propertyname) { support.haslisteners(propertyname); } declare parents: point implements serializable; /** * pointcut describing set<property> methods on point. * (uses wildcard in method name) */ pointcut setter(point p): call(void point.set*(*)) && target(p); /** * advice property alter event fired when * setters called. it's around advice because need * old value of property. */ void around(point p): setter(p) { string propertyname = thisjoinpointstaticpart.getsignature().getname().substring("set".length()); int oldx = p.getx(); int oldy = p.gety(); proceed(p); if (propertyname.equals("x")){ firepropertychange(p, propertyname, oldx, p.getx()); } else { firepropertychange(p, propertyname, oldy, p.gety()); } } /* * utility fire property alter event. */ void firepropertychange(point p, string property, double oldval, double newval) { p.support.firepropertychange(property, new double(oldval), new double(newval)); } }
java spring javabeans spring-aop
Comments
Post a Comment