|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.veriplace.client.util.MemoryRequestStore<ResultType>
public class MemoryRequestStore<ResultType>
In-memory implementation of RequestStore.
| Nested Class Summary | |
|---|---|
protected static class |
MemoryRequestStore.RequestStatus<ResultType>
|
| Field Summary | |
|---|---|
protected long |
allocator
|
protected java.util.SortedMap<java.lang.Long,java.util.LinkedList<java.lang.Long>> |
expiration
Map from expiration time (in seconds) to identifier(s). |
protected static long |
FIVE_MINUTES
|
protected java.util.Map<java.lang.Long,MemoryRequestStore.RequestStatus<ResultType>> |
requests
Map from identifier to result |
| Constructor Summary | |
|---|---|
MemoryRequestStore()
|
|
| Method Summary | |
|---|---|
long |
add()
Allocate a unique identifier for a subsequent response. |
ResultType |
get(long id)
Get the result of a request. |
void |
put(long id,
ResultType result)
Save the result of a completed request. |
boolean |
waitForCompletion(long id)
Wait for the result to be available for a previously submitted request. |
boolean |
waitForCompletion(long id,
long timeout)
Wait for the result to be available for a previously submitted request, but wait no more the timeout milliseconds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final long FIVE_MINUTES
protected long allocator
protected java.util.Map<java.lang.Long,MemoryRequestStore.RequestStatus<ResultType>> requests
protected java.util.SortedMap<java.lang.Long,java.util.LinkedList<java.lang.Long>> expiration
| Constructor Detail |
|---|
public MemoryRequestStore()
| Method Detail |
|---|
public long add()
RequestStore
add in interface RequestStore<ResultType>public boolean waitForCompletion(long id)
RequestStore
waitForCompletion in interface RequestStore<ResultType>
public boolean waitForCompletion(long id,
long timeout)
RequestStore
waitForCompletion in interface RequestStore<ResultType>
public void put(long id,
ResultType result)
RequestStore
put in interface RequestStore<ResultType>public ResultType get(long id)
RequestStore
get in interface RequestStore<ResultType>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||