|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.oscache.base.EntryUpdateState
public class EntryUpdateState
Holds the state of a Cache Entry that is in the process of being (re)generated. This is not synchronized; the synchronization must be handled by the calling classes.
Field Summary | |
---|---|
static int |
NOT_YET_UPDATING
The initial state when this object is first created |
static int |
UPDATE_CANCELLED
Update cancelled state |
static int |
UPDATE_COMPLETE
Update complete state |
static int |
UPDATE_IN_PROGRESS
Update in progress state |
Constructor Summary | |
---|---|
EntryUpdateState()
|
Method Summary | |
---|---|
int |
cancelUpdate()
Updates the state to UPDATE_CANCELLED . |
int |
completeUpdate()
Updates the state to UPDATE_COMPLETE . |
int |
decrementUsageCounter()
Decrements the usage counter by one. |
int |
getUsageCounter()
Gets the current usage counter value |
int |
incrementUsageCounter()
Increments the usage counter by one |
boolean |
isAwaitingUpdate()
This is the initial state when an instance this object is first created. |
boolean |
isCancelled()
The thread that was responsible for updating the cache entry (ie, the thread that managed to grab the update lock) has decided to give up responsibility for performing the update. |
boolean |
isComplete()
The update of the cache entry has been completed. |
boolean |
isUpdating()
The cache entry is currently being generated by the thread that got hold of the update lock. |
int |
startUpdate()
Attempt to change the state to UPDATE_IN_PROGRESS . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NOT_YET_UPDATING
public static final int UPDATE_IN_PROGRESS
public static final int UPDATE_COMPLETE
public static final int UPDATE_CANCELLED
Constructor Detail |
---|
public EntryUpdateState()
Method Detail |
---|
public boolean isAwaitingUpdate()
public boolean isCancelled()
public boolean isComplete()
public boolean isUpdating()
public int cancelUpdate()
UPDATE_CANCELLED
. This should only
be called by the thread that managed to get the update lock.
public int completeUpdate()
UPDATE_COMPLETE
. This should only
be called by the thread that managed to get the update lock.
public int startUpdate()
UPDATE_IN_PROGRESS
. Calls
to this method must be synchronized on the EntryUpdateState instance.
public int incrementUsageCounter()
public int getUsageCounter()
public int decrementUsageCounter()
|
OSCache Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |