|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ontimize.util.gis.client.defaultimplementations.cache.RequestQueryWithBuffer
public class RequestQueryWithBuffer
Request query with a fixed size requests stack.
When a new request arrives and
the current stack has the maximum size the first request in the stack is deleted and
the new request is added to the current stack.
| Field Summary | |
|---|---|
protected int |
bufferSize
|
protected java.util.concurrent.locks.Condition |
emptyQueryCondition
|
protected java.util.Hashtable<java.lang.Object,java.lang.Object> |
lastTickets
|
protected java.util.Stack<java.lang.Object> |
queryData
|
protected java.util.concurrent.locks.Lock |
queryLock
|
| Fields inherited from interface com.ontimize.util.gis.client.defaultimplementations.cache.IRequestQuery |
|---|
PARAMETER_REQUEST_DATA, PARAMETER_REQUESTER_ID |
| Constructor Summary | |
|---|---|
RequestQueryWithBuffer()
|
|
RequestQueryWithBuffer(int bufferSize)
Request query with buffer constructor |
|
| Method Summary | |
|---|---|
void |
addRequest(java.lang.Object requestData,
java.lang.Object requesterId)
Add a new data request to the pending requests stack |
java.util.concurrent.locks.Condition |
getEmptyCondition()
Get the empty stack condition reference |
java.util.concurrent.locks.Lock |
getLock()
Get the reference of the pending requests stack lock |
int |
getQueriesStackSize()
|
java.lang.Object |
getRequest()
Get the new pending request located at the top of the stack |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.concurrent.locks.Lock queryLock
protected int bufferSize
protected java.util.concurrent.locks.Condition emptyQueryCondition
protected java.util.Hashtable<java.lang.Object,java.lang.Object> lastTickets
protected java.util.Stack<java.lang.Object> queryData
| Constructor Detail |
|---|
public RequestQueryWithBuffer()
public RequestQueryWithBuffer(int bufferSize)
bufferSize - Maximum allowable stack size| Method Detail |
|---|
public java.util.concurrent.locks.Condition getEmptyCondition()
IRequestQuery
getEmptyCondition in interface IRequestQuerypublic java.util.concurrent.locks.Lock getLock()
IRequestQuery
getLock in interface IRequestQuery
public void addRequest(java.lang.Object requestData,
java.lang.Object requesterId)
IRequestQuery
addRequest in interface IRequestQueryrequestData - Requested data descriptionrequesterId - Identifier for the requesting classpublic java.lang.Object getRequest()
IRequestQuery
getRequest in interface IRequestQuerypublic int getQueriesStackSize()
getQueriesStackSize in interface IRequestQuery
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||