[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] Redirecting call to a stub with aspectj
|
- From: Andy Clement <andrew.clement@xxxxxxxxx>
- Date: Mon, 21 Sep 2009 11:45:51 -0700
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ebkrafUrJB76CQeU21+LVVVJf5yJXxZ3NNpzlkxHXg8=; b=jdKi6b3bzxiY0ZfrCgipqvNtMBZ0vi7K07RwaY+UCA3FWQYyRrJ3hvOev7NuefS48N ZbaW7OSBe6ikB8EB2zutlurN7Eo03RI+/fGunlj+eoPZ3tjFjMmtODEmQJ4uSc1TdnIB qF6tJafEtjxXPwA80h/Du6DaZajX2CQWXZthk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=AZycD2AvqOpsfO58qNGyKg0+qOq2dPmsb+9SdzfOtqimVgmkzW5qJwDWvIWl9+gL9a seywb1LLBxTiCA0XuGaWU/hSH9m0By3bSdSh5iS/lMOH9RolkHKH/B9pO1WvRPLSdDkM JW19O5B4WP+LIXv3auDkmtDfOBoGPXdC1btHw=
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
>
>