|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.util.SimpleDataRecord<T>
T - The specific subclass type is required to declare itself
to bypass some very strange Java generic class issuespublic abstract class SimpleDataRecord<T extends SimpleDataRecord<?>>
An abstract implementation of a DataRecord performing the default tasks for most of the drudgery.
| Field Summary | |
|---|---|
private boolean |
beenCached
Whether this object has been cached |
private boolean |
beingLoaded
WRITEME: Document this brpocock@star-hope.org |
protected RecordLoader<T> |
myLoader
WRITEME: Document this brpocock@star-hope.org |
private static long |
serialVersionUID
Java serialisation unique ID |
protected long |
timeLastChanged
WRITEME |
protected long |
timeLastSaved
WRITEME |
| Constructor Summary | |
|---|---|
protected |
SimpleDataRecord(Class<? extends SimpleDataRecord<T>> klass)
Protected constructor for derived classes to use, creating a new record using the default loader configured for that class |
|
SimpleDataRecord(RecordLoader<? super T> loader)
|
| Method Summary | |
|---|---|
protected void |
changed()
WRITEME: Document this method brpocock@star-hope.org |
void |
checkStale()
Indicates that a data record is stale and needs to be refreshed |
int |
compareTo(T o)
|
boolean |
equals(Object obj)
|
protected void |
finalize()
|
RecordLoader<? super T> |
getRecordLoader()
|
long |
getTimeLastChanged()
|
long |
getTimeLastSaved()
|
int |
hashCode()
|
boolean |
isBeingLoaded()
WRITEME: Document this method brpocock@star-hope.org |
void |
markAsLoaded()
WRITEME: Document this method brpocock@star-hope.org |
void |
markAsSaved()
Record the current time as the time last saved |
void |
markForReload()
Marks a record as |
void |
onRemove(Object value)
|
void |
onRetrieve(Object value)
|
void |
onStore(Object value)
|
protected void |
save()
Saves the record immediately instead of waiting |
void |
setRecordLoader(RecordLoader<? extends DataRecord> loader)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.starhope.appius.util.DataRecord |
|---|
getCacheableID, getCacheableIdent |
| Methods inherited from interface org.starhope.util.HasSubversionRevision |
|---|
getSubversionRevision |
| Field Detail |
|---|
private static final long serialVersionUID
private boolean beenCached
private boolean beingLoaded
protected transient RecordLoader<T extends SimpleDataRecord<?>> myLoader
protected long timeLastChanged
protected long timeLastSaved
| Constructor Detail |
|---|
protected SimpleDataRecord(Class<? extends SimpleDataRecord<T>> klass)
klass - the derived classpublic SimpleDataRecord(RecordLoader<? super T> loader)
loader - the record loader in use| Method Detail |
|---|
protected void changed()
public void checkStale()
DataRecord
checkStale in interface DataRecordcheckStale()public int compareTo(T o)
compareTo in interface Comparable<T extends SimpleDataRecord<?>>Comparable.compareTo(java.lang.Object)public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)protected void finalize()
finalize in class ObjectObject.finalize()public RecordLoader<? super T> getRecordLoader()
getRecordLoader in interface DataRecordDataRecord.getRecordLoader()public final long getTimeLastChanged()
getTimeLastChanged in interface CTimeCTime.getTimeLastChanged()public final long getTimeLastSaved()
getTimeLastSaved in interface CTimeCTime.getTimeLastSaved()public int hashCode()
hashCode in class ObjectObject.hashCode()public boolean isBeingLoaded()
DataRecord
isBeingLoaded in interface DataRecordDataRecord.isBeingLoaded()public void markAsLoaded()
DataRecord
markAsLoaded in interface DataRecordDataRecord.markAsLoaded()public void markForReload()
public final void markAsSaved()
DataRecord
markAsSaved in interface DataRecordDataRecord.markAsSaved()public void onRemove(Object value)
onRemove in interface com.whirlycott.cache.CacheableCacheable.onRemove(java.lang.Object)public void onRetrieve(Object value)
onRetrieve in interface com.whirlycott.cache.CacheableCacheable.onRetrieve(java.lang.Object)public void onStore(Object value)
onStore in interface com.whirlycott.cache.CacheableCacheable.onStore(java.lang.Object)protected void save()
public final void setRecordLoader(RecordLoader<? extends DataRecord> loader)
setRecordLoader in interface DataRecordloader - The record loader that should be used to save this
data recordDataRecord.setRecordLoader(org.starhope.appius.util.RecordLoader)public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||