Trace Aspect
[Java-language Group]

This aspect is defined in file: ../../AspectXLib/java/ShoppingCart/aspects/TraceAspectStd.ax

Aspect Description

This aspect traces all methods and constructors. The java base code is taken from the examples in the book 'AspectJ in Action'. It exercises both weaving rules specific to Java, adding imports (advice addImports) and adding members (advice addLoggerField). It also uses common weaving rules for adding trace calls at the begin and end of a method and before return statements.
Author:
I. Birrer

Pointcuts

functionallFunctions
 Points to the all methods
constructorallConstructors
 Points to the all construtors

Advices

beginenterFunction
 Weave the log message at the beginning of every method
endendFunction
 Weave the log message at the end of every method that has no return value
beforebeforeReturn
 Weave the log message before return statement of every method
addaddLoggerField
  Adds a logger field variable to every class that contains a construtor or a method
beginenterConstructor
  Weave the log message at the beginning of every construtor
addaddImports
  Add the import statement for the java

Pointcut Documentation

function allFunctions (source)
Points to the all methods.
constructor allConstructors (source)
Points to the all construtors.

Advice Documentation

begin enterFunction (source)

Triplet: function begin codeFragment

Weave the log message at the beginning of every method.

Refers to global pointcut: function allFunctions

end endFunction (source)

Triplet: function end codeFragment

Weave the log message at the end of every method that has no return value.

Local Pointcut: function (source)

before beforeReturn (source)

Triplet: return before codeFragment

Weave the log message before return statement of every method.

Local Pointcut: return (source)

add addLoggerField (source)

Triplet: class add member

Adds a logger field variable to every class that contains a construtor or a method.

Local Pointcut: class (source)

begin enterConstructor (source)

Triplet: constructor begin codeFragment

Weave the log message at the beginning of every construtor.

Refers to global pointcut: constructor allConstructors

add addImports (source)

Triplet: unit add import

Add the import statement for the java.util.logging.* and aspect.* packages. Inclusion of those packages is necessary because the code that is woven into the target methods calls the method logp() of calss Logger.
Targets all units that contains definition of a construtor or a method.

Local Pointcut: unit (source)