[ http://jira.codehaus.org/browse/AW-162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

admin@example... deleted AW-162:
---------------------------------


> perThread issue on Aspect member field
> --------------------------------------
>
>                 Key: AW-162
>                 URL: http://jira.codehaus.org/browse/AW-162
>             Project: AspectWerkz
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.10
>            Reporter: Alexandre Vasseur
>            Assignee: Alexandre Vasseur
>             Fix For: 0.10
>
>         Attachments: Eu.java
>
>
> This needs to be reproduced.
> -- msarr AT thresholdnetworks DOT com
> -- May 25 2004
> Using the "per Thread" deployment I would like to have the "_thread" member
> have some unique value per thread that is set once and I can log that value
> without calling java.lang.Thread.currentThread() every time. It seems as
> though the value is shared among all threads currently.
> Thanks
> /**
>  * @Aspect perThread
>  */
> public class LoggingAspect
> {
> private int _thread = java.lang.Thread.currentThread().hashCode();
>     /**
>     * @Around execution(* java.sql.Statement+.execute*(java.lang.String))
>     */
>     public Object logSQL(final JoinPoint joinPoint) throws Throwable
>      {
>       CodeRtti rtti = (CodeRtti)joinPoint.getRtti();
>       java.lang.Object[] methodParams = rtti.getParameterValues( );
>       String sql = (String) methodParams[0];
>     //  I would like the next two calls to have the same value for the 1st
> argument
>     //  currently  "_thread" seems more like a static that is shared by
> every thread (it is always the same)
>       DataLogger.log(_thread,sql);
>       DataLogger.log(java.lang.Thread.currentThread().hashCode(), sql);
>       final Object result = joinPoint.proceed();
>      return result;
>      }
> }
> _______________________________________________
> aspectwerkz-user mailing list
> aspectwerkz-user@lists.codehaus...
> http://lists.codehaus.org/mailman/listinfo/aspectwerkz-user

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Message Thread

[aspectwerkz-dev] [jira] Deleted: (AW-162) perThread issue on Aspect member field admin@example.com (JIRA) (jira@codehaus...)
02 Aug 2007
Copyright 2006-2007 The Codehaus Foundation
Powered by Codehaus March (Version: 0.1-HEAD)