mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-26 17:58:43 +02:00
21 lines
534 B
Java
21 lines
534 B
Java
public abstract aspect PerCFlowCompileFromJar percflow( topOfFlow() ){
|
|
|
|
private boolean thisAspectInstanceIsDead = false;
|
|
|
|
protected abstract pointcut entryPoint();
|
|
protected pointcut topOfFlow(): entryPoint() && !cflowbelow( entryPoint() );
|
|
|
|
after() : topOfFlow() {
|
|
this.killThisAspectInstance();
|
|
}
|
|
|
|
protected void killThisAspectInstance(){
|
|
if (thisAspectInstanceIsDead)
|
|
throw new IllegalStateException("This aspect instance has been used and can't be used again.");
|
|
else
|
|
thisAspectInstanceIsDead = true;
|
|
}
|
|
}
|
|
|
|
|