Skip to content
Snippets Groups Projects
Commit 77599328 authored by Christian Wulf's avatar Christian Wulf
Browse files

added thread pointcut examples

parent 5d2bd218
No related branches found
No related tags found
No related merge requests found
package aspects;
public aspect ThreadAspect {
before() : execution(* java.lang.Thread.start(..)) {
System.out.println(thisJoinPointStaticPart);
}
before() : call(* java.lang.Thread.start(..)) {
System.out.println(thisJoinPointStaticPart);
}
before() : call(* java.lang.Thread.run(..)) {
System.out.println(thisJoinPointStaticPart);
}
before() : execution(java.lang.Thread.new(..)) {
System.out.println(thisJoinPointStaticPart);
}
before() : call(java.lang.Thread.new(..)) {
System.out.println(thisJoinPointStaticPart);
}
}
package examples;
public class ThreadOperationsExample {
public static void main(String[] args) throws InterruptedException {
Thread thread = createThread();
thread.start();
thread.join();
}
private static Thread createThread() {
return new Thread();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment