Class ConcurrentQueueNonBlockingImpl<V>
- java.lang.Object
-
- com.sun.corba.ee.impl.transport.concurrent.ConcurrentQueueNonBlockingImpl<V>
-
- All Implemented Interfaces:
ConcurrentQueue<V>
public class ConcurrentQueueNonBlockingImpl<V> extends java.lang.Object implements ConcurrentQueue<V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ConcurrentQueueNonBlockingImpl.Entry<V>
private class
ConcurrentQueueNonBlockingImpl.HandleImpl<V>
-
Nested classes/interfaces inherited from interface com.sun.corba.ee.spi.transport.concurrent.ConcurrentQueue
ConcurrentQueue.Handle<V>
-
-
Constructor Summary
Constructors Constructor Description ConcurrentQueueNonBlockingImpl(long ttl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConcurrentQueue.Handle<V>
offer(V arg)
Add a new element to the tail of the queue.ConcurrentQueue.Handle<V>
peek()
Return the handle for the head of the queue.ConcurrentQueue.Handle<V>
poll()
Return an element from the head of the queue.int
size()
Return the number of elements in the queue.
-
-
-
Field Detail
-
head
final ConcurrentQueueNonBlockingImpl.Entry<V> head
-
lock
final java.lang.Object lock
-
count
int count
-
ttl
private long ttl
-
-
Method Detail
-
size
public int size()
Description copied from interface:ConcurrentQueue
Return the number of elements in the queue.- Specified by:
size
in interfaceConcurrentQueue<V>
- Returns:
- the number of elements
-
offer
public ConcurrentQueue.Handle<V> offer(V arg)
Add a new element to the tail of the queue. Returns a handle for the element in the queue.- Specified by:
offer
in interfaceConcurrentQueue<V>
- Parameters:
arg
- element to add- Returns:
- handle for element
-
poll
public ConcurrentQueue.Handle<V> poll()
Return an element from the head of the queue. The element is removed from the queue.- Specified by:
poll
in interfaceConcurrentQueue<V>
- Returns:
- handle for head of queue
-
peek
public ConcurrentQueue.Handle<V> peek()
Description copied from interface:ConcurrentQueue
Return the handle for the head of the queue. The element is not removed from the queue.- Specified by:
peek
in interfaceConcurrentQueue<V>
- Returns:
- handle for head of queue
-
-