Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Invoking proceed() from an inner class

Is it possible to invoke proceed() in an aspect from an inner class?

I have a need to pass off the execution of an advised method to another method that is going to invoke it as a Callable. This will all be done synchronously.

A simplified version of what I'm trying to do would be:

  public aspect MyAspect {

    Object around(final Object obj) : somePointcut(obj) {
        Callable<Object> c = new Callable<Object>() {
            @Override
            public void call() throws Exception {
                return MyAspect.this.proceed(obj);
            }
        });
        ...
        return c.call();
    }


In the real version, c gets passed off to another method that invokes and returns c.call().

If that's not possible, is there some other way to "wrap" the advised method invocation in a Callable?

Thanks,
-Archie

--
Archie L. Cobbs

Back to the top