Code example for PriorityBlockingQueue

Methods: add

0
		alarmManager.set(AlarmManager.RTC_WAKEUP, execTime, pending);
		// update pending jobs 
		TimedExecutorJob executorJob = new TimedExecutorJob(execTime, jobId,
				pending, receiver);
		pendingJobs.put(jobId, executorJob);
		pendingTimes.add(executorJob);
		shutdownLock.unlock();
		return jobId;
	} 
 
	/** 
	 * Whether the given job is still pending. 
	 *  
	 * @param jobId 
	 *            the unique identifier of the job. 
	 * @return 
	 */ 
	public boolean hasPendingJob(String jobId) {
		return pendingJobs.containsKey(jobId);
	}