|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.utils.BlockingQueue
public class BlockingQueue
A simple FIFO queue that has MIN/MAX capacity and that blocks if either enqueue/dequeue would result in violation of these limits. Default values for min/max are 0/infinite
| Field Summary | |
|---|---|
(package private) int |
maxSize
|
(package private) int |
minSize
|
(package private) java.util.LinkedList |
queue
|
| Constructor Summary | |
|---|---|
BlockingQueue()
|
|
BlockingQueue(int max)
|
|
BlockingQueue(int min,
int max)
Construct a new blocking queue with predefined max/min limits |
|
| Method Summary | |
|---|---|
java.lang.Object |
dequeue()
Remove object from the beginning of the queue |
void |
enqueue(java.lang.Object o)
Add new object to the end of the queue |
int |
getMaxSize()
|
int |
getMinSize()
|
void |
setLimits(int max,
int min)
Set the queue limits. |
void |
setMaxSize(int max)
|
void |
setMinSize(int min)
|
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
int maxSize
int minSize
volatile java.util.LinkedList queue
| Constructor Detail |
|---|
BlockingQueue()
BlockingQueue(int min,
int max)
BlockingQueue(int max)
| Method Detail |
|---|
public void enqueue(java.lang.Object o)
throws java.lang.InterruptedException
o - object to be placed on the queue
java.lang.InterruptedException
public java.lang.Object dequeue()
throws java.lang.InterruptedException
java.lang.InterruptedException - if the wait was interrupted
public void setLimits(int max,
int min)
public int getMaxSize()
public int getMinSize()
public void setMaxSize(int max)
public void setMinSize(int min)
public int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||