You can change the arguments by manipulating invocation.getArguments()
directly.

e.g.

Object[] args = invocation.getArguments();
args[0] = new Date();
((Foo)args[1]).setBar(10);

and then going forward with the invocation.proceed();

if for some reason you'd like to call the interceptor again (I really
don't imagine why do you want to do this) maybe a call to invoke
(invocation); i.e. invoke of your interceptor will do the trick. But
you need to have some sort of stopping condition so you don't loop
forever. I find it a bit odd that you'd need to call the interceptor
in a loop, maybe there is a better way;)

Cheers,
Alen


On Dec 8, 12:18 pm, under_fire <[EMAIL PROTECTED]> wrote:
> How can I change the objects passed as an argument, and that
> invocation is intercepted again?
>
>     public Object invoke(MethodInvocation invocation) throws Throwable
> {
>
>                 System.out.println(this.getClass().getName());
>                 Method method = (Method)invocation.getStaticPart();
>                 return method.invoke(invocation.getThis(),
> invocation.getArguments());
>
>     }
>
> Im try return "invocation.proceed()" but not work....
>
> Thank's
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to