Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Calling proceed in a method

Hi Andy,

Perhaps my use-case wasn't well described, but all I am attempting to do is to is refactor code from pieces of around advice, including the call to proceed(), to a common method. If there are implementation difficulties that mean this is too difficult to support in AspectJ then I am happy to use the worker pattern suggested by Ramnivas. Just wanted to make sure I wasn't missing a trick.

Many Thanks
- Ashley


-----aspectj-users-bounces@xxxxxxxxxxx wrote: -----

>To: aspectj-users@xxxxxxxxxxx
>From: "Andy Clement" <andrew.clement@xxxxxxxxx>
>Sent by: aspectj-users-bounces@xxxxxxxxxxx
>Date: 07/13/2008 01:16AM
>Subject: Re: [aspectj-users] Calling proceed in a method
>
>Hi Ashley,
>
>ProceedingJoinPoint was only designed for use with annotation style
>advice, to allow the calling of proceed() in a legal java program.  I
>have no test programs that do what you are attempting, so I don't
>know
>if it'll work or not, but my feeling is that it will not.  Probably
>if
>it is going to work at all you will need to use annotation style
>around advice as that triggers different weaver paths that may set of
>the ProceedingJoinPoint correctly before you pass it around.
>
>Unfortunately the signature for proceed() on a ProceedingJoinPoint is
>effectively Object... - so if you have problems setting up the
>parameters for the proceed it will likely manifest as a runtime error
>rather than compile time error.
>
>If you think you have a suitable use case and it isn't working,
>please
>raise a bug for us to discuss/consider what we can do.
>
>Andy.
>
>2008/7/11 Ashley Williams <ashley.williams@xxxxxx>:
>> Hi,
>>
>> I have two pieces of around advice in my code-style aspect that I
>would like
>> to refactor into an ordinary method in the same aspect. However I'm
>unsure
>> how to make the call to proceed() in this method.
>>
>> Am I supposed to cast thisJointPoint to the annotation-style
>> ProceedingJoinPoint and pass it as a paramter to the refactored
>method? If
>> so, is there a way of invoking its proceed method that would work
>> generically for the different sorts of args and return values in
>the two
>> pieces of advice that are delegating to it?
>>
>> Many thanks
>> - Ashley
>>
>> ---
>>
>> This e-mail may contain confidential and/or privileged information.
>If you
>> are not the intended recipient (or have received this e-mail in
>error)
>> please notify the sender immediately and delete this e-mail. Any
>> unauthorized copying, disclosure or distribution of the material in
>this
>> e-mail is strictly forbidden.
>>
>> Please refer to http://www.db.com/en/content/eu_disclosures.htm for
>> additional EU corporate and regulatory disclosures.
>>
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
>>
>_______________________________________________
>aspectj-users mailing list
>aspectj-users@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.


Back to the top