etm.contrib.aop.aspectwerkz
Class EtmAspectWerkzAspect
java.lang.Object
etm.contrib.aop.aspectwerkz.EtmAspectWerkzAspect
- Direct Known Subclasses:
- NamedEtmAspectWerkzAspect
public class EtmAspectWerkzAspect
- extends java.lang.Object
AspectWerkz aspect that supports method invocations. Interally it uses
a static EtmMonitor provided by EtmManager.getEtmMonitor().
Example usage that
records all method calls of all classes ending with Service using aop.xml.
<aspect class="etm.contrib.aop.aspectwerkz.EtmAspectWerkzAspect" deployment-model="perClass">
<pointcut name="monitorServices" expression="execution(* ..*Service.*(..)) "/>
<advice name="monitor" type="around" bind-to="monitorServices"/>
</aspect>
- Version:
- $Revision: 109 $
- Author:
- void.fm
|
Method Summary |
protected void |
alterNamePostException(EtmPoint aEtmPoint,
java.lang.Throwable t)
Alter name in case an exception is caught during processing. |
protected java.lang.String |
calculateName(org.codehaus.aspectwerkz.joinpoint.StaticJoinPoint joinPoint)
Calculate EtmPoint name based on the method invocation. |
protected java.lang.String |
calculateShortName(java.lang.Class clazz)
Calculate short name for a given class. |
java.lang.Object |
monitor(org.codehaus.aspectwerkz.joinpoint.StaticJoinPoint joinPoint)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
etmMonitor
protected final EtmMonitor etmMonitor
EtmAspectWerkzAspect
public EtmAspectWerkzAspect()
monitor
public java.lang.Object monitor(org.codehaus.aspectwerkz.joinpoint.StaticJoinPoint joinPoint)
throws java.lang.Throwable
- Throws:
java.lang.Throwable
calculateName
protected java.lang.String calculateName(org.codehaus.aspectwerkz.joinpoint.StaticJoinPoint joinPoint)
- Calculate EtmPoint name based on the method invocation.
- Parameters:
joinPoint - The method invocation.
- Returns:
- The name of the EtmPoint.
alterNamePostException
protected void alterNamePostException(EtmPoint aEtmPoint,
java.lang.Throwable t)
- Alter name in case an exception is caught during processing. Altering the
name takes place after executing target method. Ensure that you never cause
an exception within this code.
- Parameters:
aEtmPoint - The EtmPoint to alter.t - The caught throwable t.
calculateShortName
protected java.lang.String calculateShortName(java.lang.Class clazz)
- Calculate short name for a given class.
- Parameters:
clazz - The class object.
- Returns:
- The short name for the given class.
Copyright © 2004,2005, 2006, 2007 void.fm. All Rights Reserved.