E
- the type of elements in the queue.public class TransactionalQueueProxy<E> extends TransactionalQueueProxySupport<E>
config, name, partitionId
tx
PARTITIONING_STRATEGY
Constructor and Description |
---|
TransactionalQueueProxy(NodeEngine nodeEngine,
QueueService service,
String name,
Transaction tx) |
Modifier and Type | Method and Description |
---|---|
boolean |
offer(E e)
Inserts the specified element into this queue if it is possible to do
so immediately without violating capacity restrictions.
|
boolean |
offer(E e,
long timeout,
TimeUnit unit)
Inserts the specified element into this queue, waiting up to the
specified wait time if necessary for space to become available.
|
E |
peek() |
E |
peek(long timeout,
TimeUnit unit) |
E |
poll()
Retrieves and removes the head of this queue,
or returns
null if this queue is empty. |
E |
poll(long timeout,
TimeUnit unit)
Retrieves and removes the head of this queue, waiting up to the
specified wait time if necessary for an element to become available.
|
E |
take()
Retrieves and removes the head of this queue, waiting if necessary
until an element becomes available.
|
String |
toString() |
getName, getServiceName, size
toObjectIfNeeded
destroy, equals, getDistributedObjectName, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionId, getPartitionKey, getService, hashCode, invalidate, invokeOnPartition, isClusterVersionEqualTo, isClusterVersionGreaterOrEqual, isClusterVersionGreaterThan, isClusterVersionLessOrEqual, isClusterVersionLessThan, isClusterVersionUnknown, isClusterVersionUnknownOrGreaterOrEqual, isClusterVersionUnknownOrGreaterThan, isClusterVersionUnknownOrLessOrEqual, isClusterVersionUnknownOrLessThan, postDestroy, preDestroy, throwNotActiveException, toData
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, getPartitionKey
public TransactionalQueueProxy(NodeEngine nodeEngine, QueueService service, String name, Transaction tx)
public boolean offer(@Nonnull E e)
TransactionalQueue
true
upon success and false
if no space is currently
available.e
- the element to addtrue
if the element was added to this queue,
false
otherwisepublic boolean offer(@Nonnull E e, long timeout, @Nonnull TimeUnit unit) throws InterruptedException
TransactionalQueue
e
- the element to addtimeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determines how to interpret the
timeout
parametertrue
if successful, or false
if
the specified waiting time elapses before space is availableInterruptedException
- if interrupted while waiting@Nonnull public E take() throws InterruptedException
TransactionalQueue
InterruptedException
- if interrupted while waitingpublic E poll()
TransactionalQueue
null
if this queue is empty.null
if this queue is emptypublic E poll(long timeout, @Nonnull TimeUnit unit) throws InterruptedException
TransactionalQueue
timeout
- how long to wait before giving up, in units of
unit
unit
- a TimeUnit
determining how to interpret the
timeout
parameternull
if the
specified waiting time elapses before an element is availableInterruptedException
- if interrupted while waitingpublic E peek()
TransactionalQueue
public E peek(long timeout, TimeUnit unit) throws InterruptedException
TransactionalQueue
InterruptedException
public String toString()
toString
in class AbstractDistributedObject<QueueService>
Copyright © 2019 Hazelcast, Inc.. All rights reserved.