|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjdbm.helper.RecordManagerImpl
jdbm.recman.CacheRecordManager
public class CacheRecordManager
A RecordManager wrapping and caching another RecordManager.
Field Summary |
---|
Fields inherited from interface jdbm.RecordManager |
---|
NULL_RECID |
Constructor Summary | |
---|---|
CacheRecordManager(RecordManager recman,
int maxRecords,
boolean softCache)
Construct a CacheRecordManager wrapping another RecordManager and using a given cache policy. |
Method Summary | ||
---|---|---|
void |
clearCache()
Empty cache. |
|
void |
close()
Closes the record manager and release resources. |
|
void |
commit()
Commit (make persistent) all changes since beginning of transaction. |
|
void |
defrag()
Defragments storage, so it consumes less space. |
|
void |
delete(long recid)
Deletes a record. |
|
|
fetch(long recid,
Serializer<A> serializer)
Fetches a record using a custom serializer. |
|
|
fetch(long recid,
Serializer<A> serializer,
boolean disableCache)
Fetches a record using a custom serializer and optionaly disabled cache |
|
long |
getNamedObject(java.lang.String name)
Obtain the record id of a named object. |
|
RecordManager |
getRecordManager()
Get the underlying Record Manager. |
|
|
insert(A obj,
Serializer<A> serializer)
Inserts a new record using a custom serializer. |
|
void |
rollback()
Rollback (cancel) all changes since beginning of transaction. |
|
void |
setNamedObject(java.lang.String name,
long recid)
Set the record id of a named object. |
|
|
update(long recid,
A obj,
Serializer<A> serializer)
Updates a record using a custom serializer. |
Methods inherited from class jdbm.helper.RecordManagerImpl |
---|
fetch, hashMap, hashMap, hashMap, insert, storeMap, storeMap, treeMap, treeMap, treeMap, treeMap, treeMap, treeMap, update |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheRecordManager(RecordManager recman, int maxRecords, boolean softCache)
recman
- Wrapped RecordManagercache
- Cache policyMethod Detail |
---|
public RecordManager getRecordManager()
public <A> long insert(A obj, Serializer<A> serializer) throws java.io.IOException
RecordManager
obj
- the object for the new record.serializer
- a custom serializer
java.io.IOException
- when one of the underlying I/O operations fails.public <A> A fetch(long recid, Serializer<A> serializer, boolean disableCache) throws java.io.IOException
RecordManager
recid
- the recid for the record that must be fetched.serializer
- a custom serializerdisableCache
- true to disable any caching mechanism
java.io.IOException
- when one of the underlying I/O operations fails.public void delete(long recid) throws java.io.IOException
RecordManager
recid
- the rowid for the record that should be deleted.
java.io.IOException
- when one of the underlying I/O operations fails.public <A> void update(long recid, A obj, Serializer<A> serializer) throws java.io.IOException
RecordManager
recid
- the recid for the record that is to be updated.obj
- the new object for the record.serializer
- a custom serializer
java.io.IOException
- when one of the underlying I/O operations failspublic <A> A fetch(long recid, Serializer<A> serializer) throws java.io.IOException
RecordManager
recid
- the recid for the record that must be fetched.serializer
- a custom serializer
java.io.IOException
- when one of the underlying I/O operations fails.public void close() throws java.io.IOException
RecordManager
java.io.IOException
- when one of the underlying I/O operations fails.public void commit() throws java.io.IOException
RecordManager
java.io.IOException
public void rollback() throws java.io.IOException
RecordManager
java.io.IOException
public long getNamedObject(java.lang.String name) throws java.io.IOException
RecordManager
java.io.IOException
public void setNamedObject(java.lang.String name, long recid) throws java.io.IOException
RecordManager
java.io.IOException
public void clearCache() throws java.io.IOException
RecordManager
java.io.IOException
public void defrag() throws java.io.IOException
RecordManager
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |