Class AbstractDelegatingQueue<T>
java.lang.Object
com.broadleafcommerce.search.index.core.queue.AbstractDelegatingQueue<T>
- Type Parameters:
T- The type that will be on theReindexQueue.
- All Implemented Interfaces:
Distributable,IndexableTypeAware,ReindexQueue<T>,Iterable<T>,Collection<T>,BlockingQueue<T>,Queue<T>
- Direct Known Subclasses:
DefaultLocalArrayBlockingDelegatingQueue
Abstract implementation of a ReindexQueue that delegates its work to any implementation of a
BlockingQueue.
- Author:
- Kelly Tisdell
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractDelegatingQueue(@NonNull com.broadleafcommerce.search.api.type.IndexableType type, @NonNull BlockingQueue<T> delegate) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends T> c) voidclear()booleanbooleancontainsAll(Collection<?> c) intdrainTo(Collection<? super T> c) intdrainTo(Collection<? super T> c, int maxElements) element()The underlying queue which all work is delegated to.final com.broadleafcommerce.search.api.type.IndexableTypeComponents that implement this method should return the same, non-null value on each invocation.final StringAny arbitrary Queue name.booleanisEmpty()final booleanisLoaded()Indicates whether more data will be added to the Queue.iterator()final voidMark that there is no more data to add to this queue.booleanbooleanpeek()poll()voidintremove()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()take()Object[]toArray()<E> E[]toArray(E[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArrayMethods inherited from interface com.broadleafcommerce.search.index.core.Distributable
isDistributed
-
Constructor Details
-
AbstractDelegatingQueue
public AbstractDelegatingQueue(@NonNull @NonNull com.broadleafcommerce.search.api.type.IndexableType type, @NonNull @NonNull BlockingQueue<T> delegate)
-
-
Method Details
-
getQueueName
Description copied from interface:ReindexQueueAny arbitrary Queue name.- Specified by:
getQueueNamein interfaceReindexQueue<T>- Returns:
- the name for the queue
-
isLoaded
public final boolean isLoaded()Description copied from interface:ReindexQueueIndicates whether more data will be added to the Queue. Returns true if there is no more data to add.- Specified by:
isLoadedin interfaceReindexQueue<T>- Returns:
- whether the queue is fully loaded and no more data will be added
-
markLoaded
public final void markLoaded()Description copied from interface:ReindexQueueMark that there is no more data to add to this queue.- Specified by:
markLoadedin interfaceReindexQueue<T>
-
getIndexableType
public final com.broadleafcommerce.search.api.type.IndexableType getIndexableType()Description copied from interface:IndexableTypeAwareComponents that implement this method should return the same, non-null value on each invocation. This should basically return a constant value.- Specified by:
getIndexableTypein interfaceIndexableTypeAware- Returns:
- the associated indexable type
-
add
- Specified by:
addin interfaceBlockingQueue<T>- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceQueue<T>
-
offer
-
put
- Specified by:
putin interfaceBlockingQueue<T>- Throws:
InterruptedException
-
offer
- Specified by:
offerin interfaceBlockingQueue<T>- Throws:
InterruptedException
-
take
- Specified by:
takein interfaceBlockingQueue<T>- Throws:
InterruptedException
-
poll
- Specified by:
pollin interfaceBlockingQueue<T>- Throws:
InterruptedException
-
remainingCapacity
public int remainingCapacity()- Specified by:
remainingCapacityin interfaceBlockingQueue<T>
-
remove
- Specified by:
removein interfaceBlockingQueue<T>- Specified by:
removein interfaceCollection<T>
-
contains
- Specified by:
containsin interfaceBlockingQueue<T>- Specified by:
containsin interfaceCollection<T>
-
drainTo
- Specified by:
drainToin interfaceBlockingQueue<T>
-
drainTo
- Specified by:
drainToin interfaceBlockingQueue<T>
-
remove
-
poll
-
element
-
peek
-
size
public int size()- Specified by:
sizein interfaceCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<T>
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection<T>
-
toArray
public <E> E[] toArray(E[] a) - Specified by:
toArrayin interfaceCollection<T>
-
containsAll
- Specified by:
containsAllin interfaceCollection<T>
-
addAll
- Specified by:
addAllin interfaceCollection<T>
-
removeAll
- Specified by:
removeAllin interfaceCollection<T>
-
retainAll
- Specified by:
retainAllin interfaceCollection<T>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T>
-
getDelegate
The underlying queue which all work is delegated to.- Returns:
- the underlying delegate queue
-