示例#1
0
 /**
  * Get the worker associated with the given scope, or null.
  *
  * @return the worker associated with the current thread, or null.
  */
 public RingoWorker getCurrentWorker() {
   return currentWorker.get();
 }
示例#2
0
 /**
  * Associate a worker with the current worker and return the worker that was previously associated
  * with it, or null.
  *
  * @param worker the new worker associated with the current thread
  * @return the worker previously associated with the current thread, or null
  */
 protected RingoWorker setCurrentWorker(RingoWorker worker) {
   RingoWorker previousWorker = currentWorker.get();
   currentWorker.set(worker);
   return previousWorker;
 }