public abstract class IdQueue extends LinkedBlockingQueue<Long>
| Constructor and Description |
|---|
IdQueue(ExecutorService idExecuter,
String name,
int allocationSize) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doTopUp(Runnable runnable)
Tops up the queue.
|
protected abstract Long |
getNextId()
Returns the next value from the database.
|
Long |
poll(long timeout,
TimeUnit unit) |
clear, contains, drainTo, drainTo, iterator, offer, offer, peek, poll, put, remainingCapacity, remove, size, take, toArray, toArray, toStringadd, addAll, element, removecontainsAll, isEmpty, removeAll, retainAllclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddaddAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAllpublic IdQueue(ExecutorService idExecuter, String name, int allocationSize)
idExecuter - the executor service to submit refill tasksname - the physical name of the sequence or pkvalue of the tableallocationSize - the allocations sizeprotected void doTopUp(Runnable runnable)
runnable - the runnable to run to top-upprotected abstract Long getNextId() throws SQLException
SQLExceptionpublic Long poll(long timeout, TimeUnit unit) throws InterruptedException
poll in interface BlockingQueue<Long>poll in class LinkedBlockingQueue<Long>InterruptedExceptionCopyright © 2012 Batoo Software & Consultancy. All Rights Reserved.