Advice
This page is about what the teacher does at the moment they step in during the examination.
They look at what the pupil is reaching for and compare it with the rule sheet. They step in before anything happens, so they can still say no. Then they either let the pupil carry on, or stop them, tell them off and name the rule they broke.
What it is
Advice is the behaviour attached to a pointcut. The usual kinds are before, after (further split by normal return or thrown exception) and around, which surrounds the join point and controls whether the original code proceeds.
In Ares the advice is where a denial is produced. It reads the intended operation and its
arguments, compares them against the active policy, and either lets the call through or
throws a SecurityException naming what was attempted and what blocked it.
The advice classes are on the bootstrap append path rather than the ordinary classpath. They have to be loadable from code that itself loads very early, and they must not be shadowable by student code.
Further reading
- AspectJ Documentation and Resources — Eclipse Foundation
- Intro to AspectJ — Baeldung
- Understanding Aspect-Oriented Programming: Java and AspectJ — Aayush Shrivastav, Medium (freely readable)