Interface NamedQueue<E>
- Type Parameters:
E- the type of values in the queue
- All Superinterfaces:
AutoCloseable,Collection<E>,Iterable<E>,NamedCollection,ObservableCollection<E>,Queue<E>,Releasable
- All Known Subinterfaces:
NamedBlockingDeque<E>,NamedBlockingQueue<E>,NamedDeque<E>
- All Known Implementing Classes:
NamedDequeProxy,NamedQueueProxy,com.tangosol.net.queue.WrapperNamedDeque,com.tangosol.net.queue.WrapperNamedQueue
A
Queue based data-structure that manages values across one or more processes.
Values are typically managed in memory.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.net.NamedCollection
NamedCollection.Option -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longA special time-to-live value that can be passed to indicate that the queue default expiry should be used.static final longA special time-to-live value that can be passed to indicate that the queue entry should never expire. -
Method Summary
Modifier and TypeMethodDescriptionbooleanInsert an element to the tail thisNamedQueue.default longInsert an element to the tail thisNamedQueue.longInsert an element to the tail thisNamedQueue.intReturn the consistent hash of the queue name.com.tangosol.net.queue.QueueStatisticsReturns the current statistics for this queue.Return the Service that this NamedCollection is a part of.booleanisActive()Returnstrueif this map is not released or destroyed.default booleanisReady()Returns whether thisNamedMapis ready to be used.booleanInsert an element to the tail thisNamedQueue.Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface com.tangosol.net.NamedCollection
destroy, getName, isDestroyedMethods inherited from interface com.tangosol.util.ObservableCollection
addListener, addListener, removeListener, removeListenerMethods inherited from interface com.tangosol.net.Releasable
close, isReleased, release
-
Field Details
-
EXPIRY_DEFAULT
static final long EXPIRY_DEFAULTA special time-to-live value that can be passed to indicate that the queue default expiry should be used.- See Also:
-
EXPIRY_NEVER
static final long EXPIRY_NEVERA special time-to-live value that can be passed to indicate that the queue entry should never expire.- See Also:
-
-
Method Details
-
getService
QueueService getService()Description copied from interface:NamedCollectionReturn the Service that this NamedCollection is a part of.- Specified by:
getServicein interfaceNamedCollection- Returns:
- the Service
-
isReady
default boolean isReady()Returns whether thisNamedMapis ready to be used. An example of when this method would returnfalsewould be where a partitioned cache service that owns this cache has no storage-enabled members.- Returns:
- return
trueif theNamedMapmay be used otherwise returnsfalse. - Since:
- 14.1.1.2206.5
-
isActive
boolean isActive()Returnstrueif this map is not released or destroyed. In other words, callingisActive()is equivalent to calling!cache.isReleased() && !cache.isDestroyed().- Specified by:
isActivein interfaceReleasable- Returns:
trueif the cache is active, otherwisefalse
-
getQueueStatistics
com.tangosol.net.queue.QueueStatistics getQueueStatistics()Returns the current statistics for this queue.- Returns:
- the current statistics for this queue
-
getQueueNameHash
int getQueueNameHash()Return the consistent hash of the queue name.- Returns:
- the consistent hash of the queue name
-
append
Insert an element to the tail thisNamedQueue.- Parameters:
e- the element to insert- Returns:
- the identifier for the inserted element, or
Long.MIN_VALUEif the element could not be inserted
-
offer
Insert an element to the tail thisNamedQueue.- Parameters:
e- the element to insertcMillis- the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; passEXPIRY_DEFAULTto use the queue's default time-to-live setting; passEXPIRY_NEVERto indicate that the queue entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()- Returns:
- the identifier for the inserted element, or
Long.MIN_VALUEif the element could not be inserted
-
add
Insert an element to the tail thisNamedQueue.- Parameters:
e- the element to insertcMillis- the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; passEXPIRY_DEFAULTto use the queue's default time-to-live setting; passEXPIRY_NEVERto indicate that the queue entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()- Returns:
- the identifier for the inserted element, or
Long.MIN_VALUEif the element could not be inserted
-
append
Insert an element to the tail thisNamedQueue.- Parameters:
e- the element to insertcMillis- the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; passEXPIRY_DEFAULTto use the queue's default time-to-live setting; passEXPIRY_NEVERto indicate that the queue entry should never expire; this milliseconds value is not a date/time value, such as is returned from System.currentTimeMillis()- Returns:
- the identifier for the inserted element, or
Long.MIN_VALUEif the element could not be inserted
-