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

On Sat, Feb 21, 2015 at 6:33 PM, Holger King <HolgerKing@xxxxxxx> wrote:
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"?

That would work. More commonly you make it private and provide access via a static method e.g.

  public static Connection getCurrentConnection()
  throws IllegalStateException {     // if no connection is set in the current thread


For lots of examples look at Spring, e.g., TransactionAspectSupport.

-Archie

--
Archie L. Cobbs

Back to the top