title: Java: What are my options for event notification in my own API?
body: <p>Suppose you have an API you've written that collects data <strong>in real time</strong> in an <strong>independent thread</strong>.  Data access is thread-safe and via an interface.  E.g. <code>getData()</code> which does not block and provides the latest information.  This API is used in a number of applications; some GUI driven, others console programs.</p>
  
  <p>What options do you have to notify your application that there has been a data update?  We definitely do not want the API to depend on the application, so we do not want to <code>fireTableDataChanged()</code> or anything like that from the API.  (In our GUI application, we would call <code>fireTableDataChanged()</code> etc. after the API notifies us or we look at the API.)</p>
  
  <p>Thanks much! </p>