Skip to main content

Pointcut

Simple Story

There are countless moments in the examination where the teacher could step in. Only a few of them matter.

The teacher's choice of moments picks those out, for example every time someone reaches for a worksheet. It says where the teacher watches, not what they do there. A moment it does not pick goes unwatched, even when a pupil reaches for something forbidden in it.

Who is who

What it is​

A pointcut is a predicate over join points. It selects them by signature, by type, by annotation, or by combinations of those.

A pointcut is only as good as its coverage, and this is the central weakness of the call-site approach: the pointcut is effectively an enumerated list of call sites the weaver could find and rewrite. An operation reachable by a route the pointcut does not name is not intercepted at all.

In Ares the pointcut definitions live alongside the advice under api/aop, and the instrumentation backend uses matchers over types and methods for the same purpose.

Further reading​