|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.net.cache.ReadWriteBackingMap.ReadLatch
protected class ReadWriteBackingMap.ReadLatch
A synchronization construct used to coordinate asynchronous loads by the refresh-ahead thread with cache accesses by other threads.
The refresh-ahead thread places a new ReadLatch in the control map before performing a load operation on the cache store. The presence of the latch signals to a thread executing theReadWriteBackingMap.get(java.lang.Object)
method that an asynchronous load is in progress. This thread can then
wait on the latch to get the results of the asynchronous load. This thread
is then responsible for removing the latch from the control map.
Additionally, a thread performing a ReadWriteBackingMap.put(java.lang.Object, java.lang.Object)
or
ReadWriteBackingMap.remove(java.lang.Object)
operation can cancel an ongoing
asynchronous load using the latch. This thread is also responsible for
removing the latch from the control map.
Constructor Summary | |
---|---|
protected |
ReadWriteBackingMap.ReadLatch(Object oKey)
Create a new ReadLatch for the specified key. |
Method Summary | |
---|---|
void |
cancel()
Cancel the load operation. |
void |
cancel(Throwable t)
Cancel the load operation due to an exception. |
void |
complete(Object oValue)
Complete the load operation. |
Object |
getKey()
Return the key that is being loaded by the refresh-ahead thread. |
Object |
getValue()
Return the result of the load operation. |
boolean |
isCanceled()
Return true if the load operation has been canceled. |
boolean |
isComplete()
Return true if the load operation is complete. |
Constructor Detail |
---|
protected ReadWriteBackingMap.ReadLatch(Object oKey)
oKey
- the key that is being loaded by the refresh-ahead threadMethod Detail |
---|
public void cancel()
public void cancel(Throwable t)
public void complete(Object oValue)
oValue
- the result of the load operationpublic boolean isComplete()
getValue()
method.
public boolean isCanceled()
public Object getKey()
public Object getValue()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |