com.sleepycat.je.rep.utilint
Class RepUtils.ExceptionAwareBlockingQueue<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by java.util.concurrent.LinkedBlockingQueue<T>
              extended by com.sleepycat.je.rep.utilint.RepUtils.ExceptionAwareBlockingQueue<T>
All Implemented Interfaces:
Serializable, Iterable<T>, Collection<T>, BlockingQueue<T>, Queue<T>
Enclosing class:
RepUtils

public static class RepUtils.ExceptionAwareBlockingQueue<T>
extends LinkedBlockingQueue<T>

Like LinkedBlockingQueue, but provides a pollOrException() method that should be used instead of poll(), so that callers don't have to treat exception cases specially.

See Also:
RepUtils.ExceptionAwareCountDownLatch, Serialized Form

Field Summary
(package private)  T dummyValue
           
(package private)  EnvironmentImpl envImpl
           
 
Constructor Summary
RepUtils.ExceptionAwareBlockingQueue(EnvironmentImpl envImpl, T dummyValue)
           
 
Method Summary
 T poll(long timeout, TimeUnit unit)
          Deprecated. 
 T pollOrException(long timeout, TimeUnit unit)
           
 void releasePoll(Exception e)
           
 
Methods inherited from class java.util.concurrent.LinkedBlockingQueue
clear, drainTo, drainTo, iterator, offer, offer, peek, poll, put, remainingCapacity, remove, size, take, toArray, toArray, toString
 
Methods inherited from class java.util.AbstractQueue
add, addAll, element, remove
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, removeAll, retainAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains
 
Methods inherited from interface java.util.Queue
element, remove
 
Methods inherited from interface java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll
 

Field Detail

envImpl

final EnvironmentImpl envImpl

dummyValue

final T dummyValue
Constructor Detail

RepUtils.ExceptionAwareBlockingQueue

public RepUtils.ExceptionAwareBlockingQueue(EnvironmentImpl envImpl,
                                            T dummyValue)
Method Detail

releasePoll

public void releasePoll(Exception e)

pollOrException

public T pollOrException(long timeout,
                         TimeUnit unit)
                  throws InterruptedException,
                         DatabaseException
Throws:
InterruptedException
DatabaseException

poll

@Deprecated
public T poll(long timeout,
                         TimeUnit unit)
Deprecated. 

(Use pollOrException(long, java.util.concurrent.TimeUnit) instead.

Specified by:
poll in interface BlockingQueue<T>
Overrides:
poll in class LinkedBlockingQueue<T>


Copyright (c) 2004-2012 Oracle. All rights reserved.