Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] getting the object from a joinpoint

mfirrincieli@xxxxxxxxxxxxxxxxx wrote:
> i'm join-pointing a *.new() kind of call, and i'm getting mad cause then what
> i'd have to do is getting the object called... and i can't seem to make it
> possibile by using thisJoinPoint object.
> 
> for example if i have
> 
> MyClass c = new MyClass();
> 
> i do capture that in my aspect, but i'd also like to get the kind of object
> instantiated by new.

Not sure if I understood your question correctly but proceed() returns an
object, and in the case of a constructor that's the new object:

Object around(Object arg): CapturedConstructor(arg) && !within(Cache)
{
    ...
    createdObject = proceed(arg);
    ...
}

Holger



Back to the top