Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Using aspect to pass a metadata as a parameter through SOAP

With an intertype declaration you can add a second method that has
your additional arguments:

class Foo {
  public void someMethod(String arg1, int arg2) {
  }
}

aspect Additional {
  public void Foo.someMethod(String arg1, int arg2, float arg3) {
     someMethod(arg1,arg2);
     // do something with arg3
  }
}

After compilation Foo will have both variants of someMethod in it.

I seem to recall the earlier parts of this discussion being RMI
related though, so am not sure if what I propose above will help you.

Andy


On 23 January 2012 11:30, Ashiwan.S. <sivakumarash007@xxxxxxxxx> wrote:
> Hi All,
>
> This email is in continuation with the below thread. I understand that
> there is no feature in aspectj to change the signature of existing
> methods to add an extra parameter, without actually modifying the
> application source code. I am wondering what it would take to
> implement such a feature in aspectj. The feature can be used to add
> arguments to existing methods/functions in applications without
> modifying the source code. Since aspectj is open source, I hope
> implementing the feature is possible. I would be very much happy to
> implement it in aspectj so that I could use it for my research and
> contribute to aspectj community. Highly appreciate if someone could
> tell me if they see any issues/road blocks in implementing this
> feature in Aspectj.
>
> Thanks,
> Ashiwan
>
> On Mon, Dec 5, 2011 at 12:50 PM, Ashiwan.S. <sivakumarash007@xxxxxxxxx> wrote:
>> Hi,
>>
>> Thank you so much for the reply.
>> I guess I would have to modify the bytecode and xml specification for
>> the data (since the application has been written to use SOAP). If
>> that's the case, then I wonder if aspectj can help me at all in
>> modularizing this work.
>>
>> I am thinking of doing something as below using aspectj.
>>
>> 1. Write a client side aspect which has a nested static class inside
>> it. The class implements a remote method. The remote method will save
>> the extra data in the object every time the data is available from the
>> HTTP request.
>> 2. Write a server side aspect such that , before the actual EJB call,
>> make a remote method call to get the data and then proceed further
>> with the actual call.,
>>
>> I understand that there is an extra overhead in making RMI call for
>> every request received from the Front-end to the Business logic.
>> But I am wondering if this will even work and can be done using aspectj.
>> It would be great if someone can tell me if this can be done using
>> aspectj . If yes, will it solve my problem. Highly appreciate any
>> help.
>>
>> Thanks,
>> Ashiwan
>>
>> --
>> -Ashiwan
>
>
>
> --
> -Ashiwan
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top