Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] RE: around advice will weave pointcut ?

Rice,

Just pass all the the arguments captured in around() 
advice to the proceed() statement -- proceed(event, guard).

The type and number of argument to the advised method 
need not match with proceed(). Only the context collected 
by the around() advice need to match in type and number 
to the arguments passed to proceed().

-Ramnivas

--- Rice Yeh <riceyeh@xxxxxxxxx> wrote:
> Hi,
>   I originally programmed my advice as you suggestion
>   boolean around(Event event, Guard guard)
> But I have to call proceed() in my advice and the
> original method Guard.pass(Event) just have one
> argument and the document say the arguments in around
> must correspond to the original method. Am I wrong?
>   Thank you for your answer. I have more understanding
> of around's code weaving behavior.
> 
> Regards,
> Rice
> 
> --- isberg@xxxxxxxx wrote:
> > > But I find the precompile's java code have no
> > > effect on this pointcut method on both classes.
> > 
> > Are you compiling all files at once? That's how it
> > works.
> > 
> > In your code, you have around advice on two call
> > join points.
> > But neither the caller calls nor the callee method
> > appear in 
> > the code you provided.  In 1.0 ajc must compile at
> > least one of those
> > in source form; in 1.1, the caller must be provided.
> >  For more
> > information,see the limitations appendix of the
> > programmer's guide.
> > 
> > Also, I recommend you change your pointcuts to use
> > target() and avoid specifying the defining type of
> > the method:
> > 
> > -- from
> > 
> > 	boolean around(Event event): 
> >         call(boolean Guard.pass(Event)) &&
> > args(event) {
> >         Guard guard = (Guard)
> > thisJoinPoint.getTarget();
> >         ...
> > -- to
> > 
> > 	boolean around(Event event, Guard guard):
> >         target(guard) && args(event) && call(boolean
> > pass(Event) { 
> >         ...
> > 
> > 
> > Remember to use -XLint to see some type name errors
> > that might
> > result in pointcuts not being matched.
> > 
> > Finally, for further usage discussions, please use
> > 
> >   aspectj-users@xxxxxxxxxxxxxxx
> > 
> > See http://eclipse.org/aspectj for more information.
> > 
> > Good luck -
> > Wes
> > 
> > > -----Original Message-----
> > > From: Rice Yeh [mailto:riceyeh@xxxxxxxxx] 
> > > Sent: Friday, December 20, 2002 10:18 AM
> > > To: users@xxxxxxxxxxx
> > > Subject: around advice will weave pointcut ?
> > > 
> > > 
> > > Hi,
> > >   I have two classes A and B. B extends A. But a
> > > around advice with pointcut on a method that is
> > only
> > > implemented in A. I  have both A and B as input
> > for
> > > ajc. But I find the precompile's java code have no
> > > effect on this pointcut method on both classes.
> > >   around advice will not weave pointcut? Attached
> > is
> > > my files.
> > > 
> > > Regards,
> > > Rice
> > > 
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> > now.
> > > http://mailplus.yahoo.com
> > > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> __________________________________________________
> AspectJ users mailing list   -   users@xxxxxxxxxxx
> To be removed send mail to users-admin@xxxxxxxxxxx
> or visit http://aspectj.org/lists


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


Back to the top