mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 15:45:38 +02:00
5a07dcee3a
percflow aspects compiled from jars share one instance for all entry points
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;
|
|
}
|
|
}
|
|
|
|
|