Exemplo n.º 1
0
 public void makeRequest(Request request) {
   if (request.requiresLogin() && !hasLocalTraderAccount()) {
     throw new RuntimeException("Cannot make login request when trading is disabled");
   }
   synchronized (_requests) {
     _requests.add(request);
     _requests.notify();
   }
 }
 /**
  * Notifies this <tt>GoogleContactsSourceService</tt> that a specific <tt>GoogleContactsQuery</tt>
  * has stopped.
  *
  * @param query the <tt>GoogleContactsQuery</tt> which has stopped
  */
 void stopped(GoogleContactsQuery query) {
   synchronized (queries) {
     if (queries.remove(query)) queries.notify();
   }
 }
 /**
  * Removes query from the list of queries.
  *
  * @param query the query that will be removed.
  */
 public synchronized void removeQuery(ContactQuery query) {
   if (queries.remove(query)) queries.notify();
 }
Exemplo n.º 4
0
 public void addTask(Task t) {
   synchronized (taskQueue) {
     taskQueue.add(t);
     taskQueue.notify();
   }
 }