Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Question about using within/cflowpointcutswiththird-party jars

Also: Haven't inspected the preprocessor output for this, but why would
iajc need to weave into classes when their joinpoints are not specified
by any pointcuts? A relevant aside is that I tried this variation prior
to the one I posted earlier, but with the same result:

	pointcut hibernate(): !within(org.hibernate..*);
	pointcut notCalledByHibernate(): cflow(hibernate());

I suppose the first pointcut above would be very expensive, in the sense
that it specifies all joinpoints in the classpath/inpath other than
those within org.hibernate..* classes, yes? 

> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx 
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Neil Redding
> Sent: Friday, August 18, 2006 2:39 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: RE: [aspectj-users] Question about using 
> within/cflowpointcutswiththird-party jars
> 
> 
> Thanks Ron - a couple followup questions below:
> 
> > To weave within the hibernate classes, you would need 
> Hibernate to be 
> > on your inpath (i.e., to weave the Hibernate jars). One way 
> you might 
> > do this without building a modified version of Hibernate would be 
> > load-time weaving.
> 
> I've been assuming LTW is expensive - is it not? I think I'll 
> give it a go, since I don't want to modify Hibernate unless I 
> have to. 
> 
> > Another option would be to use cflow of calls into Hibernate. 
> > The calls from your code into Hibernate can be woven 
> without weaving 
> > into Hibernate. E.g.,
> > 
> > 	pointcut callHibernate(): 
> > 		call(* org.hibernate..*(..)) ||
> > call(org.hibernate..*.new(..));
> > 	pointcut inHibernate(): cflow(callHibernate());
> > 
> > 	pointcut setterNotCalledByHibernate():
> > 		!calledByHibernate() && execution(* *.set*(..));
> 
> Right; the issue is that I need to exclude Hibernate 
> joinpoints regardless of where they're called from - it's not 
> always from "my code". 
> 
> > Also, note that your original pointcut is rather expensive 
> (it would 
> > weave into *all join points* in Hibernate such as field get/set, 
> > handler etc). If you were going to weave into Hibernate you'd want 
> > something like:
> > 
> > 	pointcut hibernate(): 
> > 		(execution(* *(..)) || execution(* new(..))) &&
> > 		within(org.hibernate..*);
> 
> Thanks, I was a bit method-invocation-myopic there for a 
> moment - didn't consider the other joinpoint types. :-)
> 
> Dumb question (?): Why "execution(* new(..))" in the pointcut 
> immediately above - isn't this covered by "execution(* *(..))"?
> 
> Cheers,
> Neil
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 


Back to the top