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

public interface NamedQueue<E> extends NamedCollection, ObservableCollection<E>, Queue<E>
A Queue based data-structure that manages values across one or more processes. Values are typically managed in memory.
  • Field Details

    • EXPIRY_DEFAULT

      static final long EXPIRY_DEFAULT
      A 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_NEVER
      A 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 interface NamedCollection
      Returns:
      the Service
    • isReady

      default boolean isReady()
      Returns whether this NamedMap is ready to be used.

      An example of when this method would return false would be where a partitioned cache service that owns this cache has no storage-enabled members.
      Returns:
      return true if the NamedMap may be used otherwise returns false.
      Since:
      14.1.1.2206.5
    • isActive

      boolean isActive()
      Returns true if this map is not released or destroyed. In other words, calling isActive() is equivalent to calling !cache.isReleased() && !cache.isDestroyed().
      Specified by:
      isActive in interface Releasable
      Returns:
      true if the cache is active, otherwise false
    • 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

      default long append(E e)
      Insert an element to the tail this NamedQueue.
      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

      boolean offer(E e, long cMillis)
      Insert an element to the tail this NamedQueue.
      Parameters:
      e - the element to insert
      cMillis - the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; pass EXPIRY_DEFAULT to use the queue's default time-to-live setting; pass EXPIRY_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

      boolean add(E e, long cMillis)
      Insert an element to the tail this NamedQueue.
      Parameters:
      e - the element to insert
      cMillis - the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; pass EXPIRY_DEFAULT to use the queue's default time-to-live setting; pass EXPIRY_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

      long append(E e, long cMillis)
      Insert an element to the tail this NamedQueue.
      Parameters:
      e - the element to insert
      cMillis - the number of milliseconds until the queue entry will expire, also referred to as the entry's "time to live"; pass EXPIRY_DEFAULT to use the queue's default time-to-live setting; pass EXPIRY_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