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 long
A special time-to-live value that can be passed to indicate that the queue default expiry should be used.static final long
A special time-to-live value that can be passed to indicate that the queue entry should never expire. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Insert an element to the tail thisNamedQueue
.default long
Insert an element to the tail thisNamedQueue
.long
Insert an element to the tail thisNamedQueue
.int
Return the consistent hash of the queue name.com.tangosol.net.queue.QueueStatistics
Returns the current statistics for this queue.Return the Service that this NamedCollection is a part of.boolean
isActive()
Returnstrue
if this map is not released or destroyed.default boolean
isReady()
Returns whether thisNamedMap
is ready to be used.boolean
Insert 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, toArray
Methods inherited from interface com.tangosol.net.NamedCollection
destroy, getName, isDestroyed
Methods inherited from interface com.tangosol.util.ObservableCollection
addListener, addListener, removeListener, removeListener
Methods 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:NamedCollection
Return the Service that this NamedCollection is a part of.- Specified by:
getService
in interfaceNamedCollection
- Returns:
- the Service
-
isReady
default boolean isReady()Returns whether thisNamedMap
is ready to be used. An example of when this method would returnfalse
would be where a partitioned cache service that owns this cache has no storage-enabled members.- Returns:
- return
true
if theNamedMap
may be used otherwise returnsfalse
. - Since:
- 14.1.1.2206.5
-
isActive
boolean isActive()Returnstrue
if this map is not released or destroyed. In other words, callingisActive()
is equivalent to calling!cache.isReleased() && !cache.isDestroyed()
.- Specified by:
isActive
in interfaceReleasable
- Returns:
true
if 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_VALUE
if 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_DEFAULT
to use the queue's default time-to-live setting; passEXPIRY_NEVER
to 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_VALUE
if 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_DEFAULT
to use the queue's default time-to-live setting; passEXPIRY_NEVER
to 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_VALUE
if 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_DEFAULT
to use the queue's default time-to-live setting; passEXPIRY_NEVER
to 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_VALUE
if the element could not be inserted
-