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 TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends T> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) int
drainTo
(Collection<? super T> c) int
drainTo
(Collection<? super T> c, int maxElements) element()
The underlying queue which all work is delegated to.final com.broadleafcommerce.search.api.type.IndexableType
Components that implement this method should return the same, non-null value on each invocation.final String
Any arbitrary Queue name.boolean
isEmpty()
final boolean
isLoaded()
Indicates whether more data will be added to the Queue.iterator()
final void
Mark that there is no more data to add to this queue.boolean
boolean
peek()
poll()
void
int
remove()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
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, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
Methods 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:ReindexQueue
Any arbitrary Queue name.- Specified by:
getQueueName
in interfaceReindexQueue<T>
- Returns:
- the name for the queue
-
isLoaded
public final boolean isLoaded()Description copied from interface:ReindexQueue
Indicates whether more data will be added to the Queue. Returns true if there is no more data to add.- Specified by:
isLoaded
in 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:ReindexQueue
Mark that there is no more data to add to this queue.- Specified by:
markLoaded
in interfaceReindexQueue<T>
-
getIndexableType
public final com.broadleafcommerce.search.api.type.IndexableType getIndexableType()Description copied from interface:IndexableTypeAware
Components that implement this method should return the same, non-null value on each invocation. This should basically return a constant value.- Specified by:
getIndexableType
in interfaceIndexableTypeAware
- Returns:
- the associated indexable type
-
add
- Specified by:
add
in interfaceBlockingQueue<T>
- Specified by:
add
in interfaceCollection<T>
- Specified by:
add
in interfaceQueue<T>
-
offer
-
put
- Specified by:
put
in interfaceBlockingQueue<T>
- Throws:
InterruptedException
-
offer
- Specified by:
offer
in interfaceBlockingQueue<T>
- Throws:
InterruptedException
-
take
- Specified by:
take
in interfaceBlockingQueue<T>
- Throws:
InterruptedException
-
poll
- Specified by:
poll
in interfaceBlockingQueue<T>
- Throws:
InterruptedException
-
remainingCapacity
public int remainingCapacity()- Specified by:
remainingCapacity
in interfaceBlockingQueue<T>
-
remove
- Specified by:
remove
in interfaceBlockingQueue<T>
- Specified by:
remove
in interfaceCollection<T>
-
contains
- Specified by:
contains
in interfaceBlockingQueue<T>
- Specified by:
contains
in interfaceCollection<T>
-
drainTo
- Specified by:
drainTo
in interfaceBlockingQueue<T>
-
drainTo
- Specified by:
drainTo
in interfaceBlockingQueue<T>
-
remove
-
poll
-
element
-
peek
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<T>
-
iterator
-
toArray
- Specified by:
toArray
in interfaceCollection<T>
-
toArray
public <E> E[] toArray(E[] a) - Specified by:
toArray
in interfaceCollection<T>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
-
addAll
- Specified by:
addAll
in interfaceCollection<T>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<T>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<T>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T>
-
getDelegate
The underlying queue which all work is delegated to.- Returns:
- the underlying delegate queue
-