trouble with static pointcuts 2.0

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown trouble with static pointcuts 2.0

by Michael Wyszinski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

All, I have several aspects running correctly in weblogic but, having
trouble advising a certain static method, I've tried several diff
pointcut definitions but it never works on this particular class. It
has worked on a similar non-static method….Any help to debug this
would be appreciated



Here are the details



=====================================================

XML def

=====================================================



       <!-- Aspect to capture username in trxns-->
     <aspect class="GetUserAspect" deployment-model="perInstance">
           <pointcut name="SetUser" expression="execution(public
static void com.xxx.core.audit.Log.setUser(..))"/>
           <advice name="storeUserName(StaticJoinPoint jp)"
type="after returning" bind-to="SetUser"/>
           <param name="test" value="i got loaded"/>
     </aspect>



=====================================================

target

=====================================================



package com.xxx.core.audit;



public class Log
{
 public static void setUser(String message)
 {stuff…}

}



=====================================================

Aspect clas

=====================================================



import org.codehaus.aspectwerkz.AspectContext;
import org.codehaus.aspectwerkz.joinpoint.*;




public class GetUserAspect{
     private static ThreadLocal userName = new ThreadLocal();
    private AspectContext myAspectContext = null;

     public NextgenGetUserAspect(AspectContext ac){
     myAspectContext = ac;
    System.out.println("test init->" + myAspectContext.getParameter("test"));
     }



  public static void setUserName(String name) {
  userName.set(name);
 }
 public static String getUserName() {
  return (String) userName.get();
 }
 public Object storeUserName(StaticJoinPoint  joinPoint) throws Throwable {
  System.out.println("NextgenMonitoring SET USERNAME ");
  return null;
 }



}

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

    http://xircles.codehaus.org/manage_email

LightInTheBox - Buy quality products at wholesale price!