00001 public class BSLObserver 00002 { 00003 00004 public static void main (java.lang.String[] args) 00005 { 00006 Subject s = new Subject(); 00007 (new SubjectThread(s)).start(); 00008 Watcher w1 = new Watcher(); 00009 Watcher w2 = new Watcher(); 00010 Watcher w; 00011 while (true) 00012 { 00013 if (edu.ksu.cis.bandera.abstraction.Abstraction.choose()) 00014 { 00015 w = w1; 00016 } else 00017 { 00018 w = w2; 00019 } 00020 s.addObserver(w); 00021 s.deleteObserver(w); 00022 } 00023 } 00024 }