not sure I follow re: two classes or two instances;

I get only one instance of the instrumented class Base$$EnhancerByGuice
$$
inside the MethodInterceptor.invoke();

now, I get "Method call = Base.call()" via reflection;

all that is left is to do something like this:

http://cglib.sourceforge.net/apidocs/net/sf/cglib/MethodProxy.html#invokeSuper%28java.lang.Object,%20java.lang.Object[]%29

((MethodProxy) call).invokeSuper(instance, args)

-- the same way guice does this internally with cglib;

but I see no way to find the underlying MethodProxy;

please take a look on complete working example of what I am trying to
do:

http://kenai.com/projects/guts/sources/code/show/trunk/guts-sandbox/guts-binding/src/test/java/bench/idea?rev=520

thank you!

On Sep 23, 1:35 pm, Andrei Pozolotin <[email protected]>
wrote:
> Dhanji, Sam:
>
> thanks for sharing your ideas; I still can not come up with working
> example;
>
> do you know if there is such piece of code anywhere?
>
> Andrei
>
> On Sep 22, 9:15 pm, "Dhanji R. Prasanna" <[email protected]> wrote:
>
> > You could do it by binding two different instances and using an instance
> > matcher.
>
> > Dhanji.
>
> > On Thu, Sep 23, 2010 at 12:08 PM, Sam Berlin <[email protected]> wrote:
> > > This is actually a deficiency in the Binder API right now -- interceptors
> > > match based on Class (and Method), not Key.   I looked into this a while 
> > > ago
> > > when someone asked a similar question internally, and there didn't seem to
> > > be any reason within the implementation that it was limited to Class (as
> > > opposed to Key), but changing it to Key would be a clunky API change (it
> > > would require an additional method name... it can't be an overloaded 
> > > method
> > > because the limitation on Class is in the generics, and the generic types
> > > would clash).
>
> > > sam
>
> > > On Wed, Sep 22, 2010 at 9:45 PM, Dhanji R. Prasanna 
> > > <[email protected]>wrote:
>
> > >> The simple way to do it would be to bind the class to two different keys:
> > >> one which gets intercepted and one that doesn't.
>
> > >> Dhanji.
>
> > >> On Wed, Sep 22, 2010 at 7:37 AM, Andrei Pozolotin <
> > >> [email protected]> wrote:
>
> > >>> Hello;
>
> > >>> SITUATOIN:
>
> > >>> when I use guice aop interceptor for a class:
>
> > >>> class Base { void call() {} }
>
> > >>> the guice aop will use cglib to produce a proxy derived class, such
> > >>> as:
>
> > >>> class Base&&EnhancerByGuice$$12345678 extends Base { void call() {} }
>
> > >>> PROBLEM:
>
> > >>> how can I call original Base.call() method and NOT EnhancerByGuice?
>
> > >>> in the spirit of invokeSuper():
>
> > >>>http://cglib.sourceforge.net/apidocs/net/sf/cglib/MethodProxy.html#in...[]%29
>
> > >>> Thank you;
>
> > >>> Andrei
>
> > >>> --
> > >>> 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]<google-guice%[email protected]>
> > >>> .
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/google-guice?hl=en.
>
> > >>  --
> > >> 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]<google-guice%[email protected]>
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/google-guice?hl=en.
>
> > >  --
> > > 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]<google-guice%[email protected]>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-guice?hl=en.

-- 
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