Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Redirecting call to a stub with aspectj

Thanks for the quick answer, that made the trick. I didn't realize there's a subclass I can cast Signature to, but it makes sense now.

K

On Mon, Sep 21, 2009 at 8:45 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
how about this:

before(): execution(* C.foo(..)) {
       MethodSignature sig = (MethodSignature)thisJoinPoint.getSignature();
       Class[] clazzes = sig.getParameterTypes();
       for (Class clazz: clazzes) {
               System.out.println(clazz.getName());
       }
}

Andy

2009/9/21 Kristof Jozsa <kristof.jozsa@xxxxxxxxx>:
> Hi,
>
> I'd like to use aspectj to intercept EJB calls and redirect the calls (if
> needed based on the interceptor configuration) to plain classes used as
> stubs. My question if it's possible to retrieve the exact arguments needed
> to find the correct method with the same signature on the stub class for a
> successful invokation.
>
> I saw that thisJoinPointStaticPart.getSignature() includes the name of the
> class and the method getting intercepted, but what about the arguments
> types? For reflection I'd need all argument type classes to find the same
> signature method  - or is it any other way to get around this task besides
> reflection? Maybe I could alter the invocation context replacing the current
> target with the stub class and proceed with the call?
>
> Thanks,
> K
>
> _______________________________________________
> 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


Back to the top