Class ForwardingBlockingDeque<E>

  • All Implemented Interfaces:
    Iterable<E>, Collection<E>, BlockingDeque<E>, BlockingQueue<E>, Deque<E>, Queue<E>

    public abstract class ForwardingBlockingDeque<E>
    extends ForwardingDeque<E>
    implements BlockingDeque<E>
    A BlockingDeque which forwards all its method calls to another BlockingDeque. Subclasses should override one or more methods to modify the behavior of the backing deque as desired per the decorator pattern.

    Warning: The methods of ForwardingBlockingDeque forward indiscriminately to the methods of the delegate. For example, overriding ForwardingCollection.add(E) alone will not change the behaviour of offer(E, long, java.util.concurrent.TimeUnit) which can lead to unexpected behaviour. In this case, you should override offer as well, either providing your own implementation, or delegating to the provided standardOffer method.

    The standard methods are not guaranteed to be thread-safe, even when all of the methods that they depend on are thread-safe.

    Since:
    14.0