examples:example2

Pointcuts: Matching Sequences

While the aspect definition in the previous example appropriately modularizes the new feature, it is a typical example of a stateful aspect, implemented with book-keeping code (the times variable in the pointcut). Recognizing this fact, we now present an alternative implementation that uses a general-purpose trace PCD for matching sequences of events.

Toggle between the code and example


AspectScript permits to expose context information to either the advice or other pointcuts, a pointcut can take as optional parameter an environment, and define new bindings in it. Using this environment, we can match a sequence of removeTag invocations happening in a 10 seconds interval. The following window uses the “trace” PCD with an environment:

Toggle between the code and example

  • examples/example2.txt
  • Last modified: 2009/11/06 16:42
  • by aspectscript