/**
   * Subscribes listener to the list of objects notified when World Changes
   *
   * @param listener IChangesListener to be added to subscribents list
   */
  public void addWorldChangesListener(IChangesListener listener) {
    if (listeners == null) listeners = new LinkedBlockingQueue<IChangesListener>();

    if (!listeners.contains(listener)) {
      listeners.add(listener);
    }
  }
Esempio n. 2
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.mixare.mgr.downloader.DownloadManager#submitJob(org.mixare.mgr.downloader
  * .DownloadRequest)
  */
 public String submitJob(DownloadRequest job) {
   String jobId = null;
   if (job != null && job.getSource().isWellFormed()) {
     ManagedDownloadRequest mJob;
     if (!todoList.contains(job)) {
       mJob = new ManagedDownloadRequest(job);
       todoList.add(mJob);
       Log.i(MixView.TAG, "Submitted " + job.toString());
       jobId = mJob.getUniqueKey();
     }
   }
   return jobId;
 }
 @Override
 public boolean contains(Object o) {
   return queue.contains(o);
 }