1 7 package local; 8 9 import ch.ethz.prose.*; 10 11 12 13 import java.util.*; 15 import java.io.*; 16 22 public 23 class Foo 24 { 25 public void baz(String arg1) 26 { 27 System.err.println ("Called: " + this + ".baz(" + arg1 + ")"); 28 } 29 30 public void bar(String arg1) 31 { 32 System.err.println ("Called: " + this + ".bar(" + arg1 + ")"); 33 } 34 35 public void barbaz(String arg1, int count) 36 { 37 System.err.println ("Called: " + this + ".barbaz(" + arg1 + "," + count + ")"); 38 } 39 40 public static void main(String [] args) throws Exception 41 { 42 ProseSystem.startup(); 43 44 ExampleAspect asp = new ExampleAspect(); 45 ProseSystem.getAspectManager().insert(asp); 46 47 Foo obj = new Foo(); 48 while(true) 49 { 50 try {Thread.currentThread().sleep(3000);} catch(InterruptedException e){} 51 obj.baz("Hello"); System.err.println("\n\n"); 52 obj.bar("Sheherazade"); System.err.println("\n\n"); 53 obj.barbaz("Nights",1001); 54 } 55 } 56 57 } 58 59 60 | Popular Tags |