Skip to main content

Advice

Simple Story

Advice is what the teacher does at the moment they step in.

You can act just before, just after, or wrap yourself around the moment so that you decide whether the thing happens at all. For a checklist, that last one is the power that matters: you can refuse.

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