mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 15:45:38 +02:00
31 lines
660 B
Java
31 lines
660 B
Java
|
import sub.ExecutionMonitor;
|
||
|
import sub.ObserverProtocol;
|
||
|
|
||
|
|
||
|
public class TransactionTest {
|
||
|
public static void main(String[] args) {
|
||
|
}
|
||
|
|
||
|
static Transaction theTransaction;
|
||
|
|
||
|
private void assertCommitted() {
|
||
|
theTransaction.getCount("method-execution", "commit");
|
||
|
}
|
||
|
|
||
|
static aspect MonitorTest {
|
||
|
declare parents: Transaction implements ExecutionMonitor.MonitoredItem;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class Transaction {
|
||
|
}
|
||
|
|
||
|
aspect TransactionControl {
|
||
|
void begin() {
|
||
|
CommitObserver.aspectOf().add(this);
|
||
|
}
|
||
|
static aspect CommitObserver extends ObserverProtocol {
|
||
|
declare parents: TransactionControl implements Observer;
|
||
|
}
|
||
|
}
|