Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Passing a parameter created in an advice to the pointcut implementation

So, when using a ThreadLocal you would declare it as "public static" to allow accessing the added connection object in the target code, here the "FSIdmAdaptor"?

@Aspect
public class FSConnectionAspect {
    public static ThreadLocal<Connection> threadLocal = new ThreadLocal<>();

    threadLocal.set(ConnectionManager.getConnection(<host>,<port>,<mode>,<user>,<password>))
}

If you do not agree it would be kind to offer a little pseudo code to get a better understanding how to offer the created connection in the advice to the pointcut matching implementation.

Besides, it's yet unclear for me how the solution offered by "Anggiat Barita" using "percflow" could solve that problem more easier..

A little explanation might help here, too :-)


Am .02.2015, 20:10 Uhr, schrieb Archie Cobbs <archie@xxxxxxxxxxxx>:

Why not just use a ThreadLocal?

-Archie

Back to the top