public interface XQueue
Modifier and Type | Field and Description |
---|---|
static int |
CELL_EMPTY |
static int |
CELL_OCCUPIED |
static int |
CELL_OUTBOUND |
static int |
CELL_RESERVED |
static int |
CELL_TAKEN |
static int |
EXTERNAL_XA |
static int |
KEEP_RUNNING |
static int |
PAUSE |
static int |
STANDBY |
static int |
XQ_ERROR |
Modifier and Type | Method and Description |
---|---|
int |
add(java.lang.Object obj,
int index)
adds a new object to the cell with the id and returns the depth of the
queue upon success or -1 to indicate failure.
|
int |
add(java.lang.Object obj,
int index,
XQCallbackWrapper callback)
adds a new object and the callback wrapper to the cell with the id and
returns the depth of the queue upon success or -1 to indicate failure.
|
boolean |
available()
returns true if any new objects in the queue or false otherwise
|
java.lang.Object |
browse(int id)
returns the object in the cell with the id or null if the id is out of
bound or the cell at the id is empty.
|
Browser |
browser()
returns an instance of Browser for browsing ids of all occupied cells
|
int |
cancel(int id)
cancels the reservation on the cell with the id and returns the
watermark upon success or -1 otherwise.
|
void |
clear()
clear all cells and reset all marks
|
int |
collect(long milliSec)
collects the next collectible cell and returns its id
|
int |
collect(long milliSec,
int id)
collects the empty cell at the id and marks it as non-collectible.
|
int |
collect(long milliSec,
int begin,
int len)
collects the first collectible cell out of len cells starting from begin
and returns its id
|
int |
collectible()
returns the number of collectible objects in the queue
|
int |
depth()
returns the number of new objects in the queue
|
int |
getCapacity()
returns the capacity of the queue
|
int |
getCellStatus(int id)
returns the status of the cell with the id
|
long |
getCount()
returns the number of objects taken out of the queue since the
reset at its timestamp
|
int |
getGlobalMask()
returns the global mask of the queue
|
long |
getMTime()
returns the timestamp of the reset on the queue
|
java.lang.String |
getName()
returns the name of the queue
|
int |
getNextCell(long milliSec)
returns the id of the next occupied cell or -1 if there is none of
the occupied cells available.
|
int |
getNextCell(long milliSec,
int id)
verifies the occupency on the cell with the id and returns the id if it
is occupied or -1 otherwise.
|
int |
getNextCell(long milliSec,
int begin,
int len)
returns the id of the first available occupied cell in the range of
len cells starting from begin or -1 if there is none of the occupied
cells available.
|
boolean |
isCollectible()
returns true if the queue supports collectible() and collect()
|
boolean |
isFull()
returns true if the queue is full or false otherwise
|
int |
locate(int[] ids,
int begin,
int len)
locates all unreserved empty cells among the given ids in the
list ranging from the id of begin thru the id of begin+len-1 and
returns the number of ids found or -1 to indicate errors.
|
int |
putback(int id)
puts the in-use object back to the cell with the id and returns the depth
of the queue upon success or -1 otherwise.
|
int |
remove(int id)
removes the in-use object from the cell with the id and returns the size
of the queue upon success or -1 otherwise.
|
int |
reserve(long milliSec)
reserves an empty cell and returns its id upon success or -1 otherwise.
|
int |
reserve(long milliSec,
int id)
reserves the empty cell with the id and returns the id upon success or -1
otherwise.
|
int |
reserve(long milliSec,
int begin,
int len)
reserves an empty cell in the range of len cells starting from begin
and returns the id of the cell upon success or -1 otherwise.
|
long |
reset()
resets the counter to 0, updates the timestamp and returns the total
number of objects taken out of the queue since the previous reset
|
void |
setGlobalMask(int mask)
sets the global mask of the queue
|
int |
size()
returns the number of objects in the queue, new and taken
|
java.lang.Object |
takeback(int index)
takes back the new object in the cell with the id and sets the cell
EMPTY again.
|
static final int XQ_ERROR
static final int KEEP_RUNNING
static final int PAUSE
static final int STANDBY
static final int EXTERNAL_XA
static final int CELL_OUTBOUND
static final int CELL_EMPTY
static final int CELL_RESERVED
static final int CELL_OCCUPIED
static final int CELL_TAKEN
int size()
int depth()
int collectible()
long getCount()
long getMTime()
long reset()
java.lang.String getName()
int getCapacity()
int getGlobalMask()
void setGlobalMask(int mask)
boolean available()
boolean isFull()
boolean isCollectible()
int getCellStatus(int id)
int collect(long milliSec, int id)
int collect(long milliSec, int begin, int len)
int collect(long milliSec)
int reserve(long milliSec)
int reserve(long milliSec, int id)
int reserve(long milliSec, int begin, int len)
int cancel(int id)
int add(java.lang.Object obj, int index)
int add(java.lang.Object obj, int index, XQCallbackWrapper callback)
java.lang.Object takeback(int index)
int getNextCell(long milliSec)
int getNextCell(long milliSec, int begin, int len)
int getNextCell(long milliSec, int id)
java.lang.Object browse(int id)
int putback(int id)
int remove(int id)
int locate(int[] ids, int begin, int len)
void clear()
Browser browser()