Using java's Observer and Observable.