Ejemplo n.º 1
0
 public void downloadInactive(Download download) {
   synchronized (listeners) {
     for (int i = 0; i < listenersDownload.size(); i++) {
       Download lDownload = (Download) listenersDownload.get(i);
       if (download.equals(lDownload)) {
         MessageListener listener = (MessageListener) listeners.get(i);
         listener.downloadInactive(download);
       }
     }
   }
 }
Ejemplo n.º 2
0
  @SuppressWarnings("unchecked")
  public void addMessageListener(MessageListener listener, Download download) {
    synchronized (listeners) {
      listeners.add(listener);
      listenersDownload.add(download);
    }

    listener.downloadAdded(download);
    if (controller.isDownloadActive(download)) {
      listener.downloadActive(download);
    } else {
      listener.downloadInactive(download);
    }
  }