Package com.hazelcast.transaction
Interface TransactionalQueue<E>
- Type Parameters:
E- the type of elements held in this collection
- All Superinterfaces:
BaseQueue<E>,DistributedObject,TransactionalObject
Transactional implementation of
BaseQueue.-
Method Summary
Modifier and TypeMethodDescriptionbooleanInserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions.booleanInserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.peek()poll()Retrieves and removes the head of this queue, or returnsnullif this queue is empty.Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.intsize()Returns the number of elements in this collection.take()Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.Methods inherited from interface com.hazelcast.core.DistributedObject
destroy, getDestroyContextForTenant, getName, getPartitionKey, getServiceName
-
Method Details
-
offer
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions. Returnstrueupon success andfalseif no space is currently available. -
offer
Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to become available.- Specified by:
offerin interfaceBaseQueue<E>- Parameters:
e- the element to addtimeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermines how to interpret thetimeoutparameter- Returns:
trueif successful, orfalseif the specified waiting time elapses before space is available- Throws:
InterruptedException- if interrupted while waiting
-
take
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.- Specified by:
takein interfaceBaseQueue<E>- Returns:
- the head of this queue
- Throws:
InterruptedException- if interrupted while waiting
-
poll
E poll()Retrieves and removes the head of this queue, or returnsnullif this queue is empty. -
poll
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollin interfaceBaseQueue<E>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-
peek
E peek() -
peek
- Throws:
InterruptedException
-
size
int size()Returns the number of elements in this collection. If this collection contains more thanInteger.MAX_VALUEelements, returnsInteger.MAX_VALUE.
-