1 7 8 import ch.ethz.prose.*; 9 10 11 12 import java.util.*; 14 import java.io.*; 15 import ch.ethz.prose.tools.RemoteProseComponent; 16 23 public 24 class Foo 25 { 26 public void baz(String arg1) 27 { 28 System.err.println ("Called: " + this + ".baz(" + arg1 + ")"); 29 } 30 31 public void bar(String arg1) 32 { 33 System.err.println ("Called: " + this + ".bar(" + arg1 + ")"); 34 } 35 36 public void barbaz(String arg1, int count) 37 { 38 System.err.println ("Called: " + this + ".barbaz(" + arg1 + "," + count + ")"); 39 } 40 41 public static void main(String [] args) throws Exception 42 { 43 ProseSystem.startup(); 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"); 52 obj.bar("Sheherazade"); 53 obj.barbaz("Nights",1001); 54 System.err.println("\n"); 55 } 56 } 57 58 } 59 60 61 | Popular Tags |