|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.mmbase.remote.Queue
| Field Summary | |
int |
appendTimeoutTime
|
static int |
DEFAULT_APPEND_TIMEOUT
Default timeout of 0 for a blocking append call |
static int |
DEFAULT_GET_TIMEOUT
Default timeout of 0 for a blocking get call |
static int |
DEFAULT_QUEUE_SIZE
Default size of 32 for the queue if none is specified. |
int |
getTimeoutTime
|
java.util.Vector |
items
|
| Constructor Summary | |
Queue()
Constructs the queue with the default queue size set to DEFAULT_QUEUE_SIZE, and the append timeout set to DEFAULT_APPEND_TIMEOUT |
|
Queue(int size)
Constructs the queue, sets the max number of queueable items to the given size, sets the append timeout to DEFAULT_APPEND_TIMEOUT, and sets the get timeout to DEFAULT_GET_TIMEOUT |
|
Queue(int size,
int appendTimeout,
int getTimeout)
Constructs the queue, sets the max number of queueable items to the given size, and sets the append() and get() timeouts to the given values. |
|
| Method Summary | |
void |
append(java.lang.Object item)
Appends the given item to the queue. |
void |
appendTimeout()
This is called every time we timeout while waiting to append something to the queue. |
int |
count()
Returns the number of items currently in the queue. |
java.lang.Object |
get()
Pulls an item off of the queue. |
void |
getTimeout()
Pretty much the same thing as the getTimeout() method, but for blocking get() timeouts. |
void |
newQueue(int size,
int appendTimeout,
int getTimeout)
|
int |
queueSize()
Returns the size of the queue |
void |
resize(int newsize)
Resizes the queue so that it can contain at most the given number of items in it. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public java.util.Vector items
public int appendTimeoutTime
public int getTimeoutTime
public static int DEFAULT_QUEUE_SIZE
public static int DEFAULT_APPEND_TIMEOUT
public static int DEFAULT_GET_TIMEOUT
| Constructor Detail |
public Queue()
DEFAULT_QUEUE_SIZE,
DEFAULT_APPEND_TIMEOUTpublic Queue(int size)
size - The maximum size of the queueDEFAULT_APPEND_TIMEOUT
public Queue(int size,
int appendTimeout,
int getTimeout)
size - The maximum size of the queueappendTimeout - If we can't append() within this many milliseconds,
the appendTimeout() method is called before retrying.getTimeout - If we can't get() something within this many
milliseconds, the getTimeout() method is called.appendTimeout(),
getTimeout()| Method Detail |
public void newQueue(int size,
int appendTimeout,
int getTimeout)
public int queueSize()
public int count()
public void append(java.lang.Object item)
item - The item to be appended to the queuepublic java.lang.Object get()
public void appendTimeout()
appendTimeoutTimepublic void getTimeout()
getTimeoutTimepublic void resize(int newsize)
newsize - The new maximum size of the queue
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||