[aspectwerkz-user] trouble with static pointcuts 2.0
"mike wyszinski" <[email protected]> Wed, 7 Nov 2007 17:04:48 -0500
| Newsgroups | gmane.comp.java.aspectwerkz.user |
|---|---|
| Message-ID | <[email protected]> |
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=85.Any help to debug this
would be appreciated
Here are the details
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
XML def
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
<!-- Aspect to capture username in trxns-->
<aspect class=3D"GetUserAspect" deployment-model=3D"perInstance">
<pointcut name=3D"SetUser" expression=3D"execution(public
static void com.xxx.core.audit.Log.setUser(..))"/>
<advice name=3D"storeUserName(StaticJoinPoint jp)"
type=3D"after returning" bind-to=3D"SetUser"/>
<param name=3D"test" value=3D"i got loaded"/>
</aspect>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
target
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
package com.xxx.core.audit;
public class Log
{
public static void setUser(String message)
{stuff=85}
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
Aspect clas
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
import org.codehaus.aspectwerkz.AspectContext;
import org.codehaus.aspectwerkz.joinpoint.*;
public class GetUserAspect{
private static ThreadLocal userName =3D new ThreadLocal();
private AspectContext myAspectContext =3D null;
public NextgenGetUserAspect(AspectContext ac){
myAspectContext =3D 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