|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.persist.file.DbFile
An abstraction of a flat file that is contain data for a particular persistent object.
Constructor Summary | |
DbFile(java.lang.String aFileName)
Create a RandomAccessFile with the provided file name to hold 'database' records. |
Method Summary | |
void |
appendObject(Persistence obj,
byte[] data)
|
void |
associate(Persistence obj,
RecordHeader header)
Match the Object with it's RecordHeader |
static java.lang.Object |
buildPrimaryKeyString(Persistence p)
|
void |
close()
Close the file and release any locks we may have. |
void |
delete(Persistence obj)
You can only delete objects that were retieved from the file broker. |
long |
getNextIdx()
Get the next index value. |
protected RecordHeader |
getRecordHeader(Persistence obj)
Locate the record header for this persistent object. |
java.io.RandomAccessFile |
getSourceFile()
|
protected void |
initialize(java.lang.String aFileName)
|
boolean |
isInUse()
Is this file currently in use by this process? |
boolean |
isLocked()
Is this file currently locked by this process? |
java.util.Iterator |
iterator()
|
void |
lock()
Take a lock out on the file so that we have exclusive access to this file. |
void |
releaseLock()
Remove the file lock and update the last known index |
void |
save(Persistence obj,
byte[] data)
Save the provided persistent object. |
void |
setInUse(boolean bValue)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DbFile(java.lang.String aFileName)
aFileName
- Method Detail |
public static java.lang.Object buildPrimaryKeyString(Persistence p)
p
-
public void setInUse(boolean bValue)
bValue
- The new InUse valuepublic long getNextIdx()
public final boolean isInUse()
public final boolean isLocked()
public java.io.RandomAccessFile getSourceFile()
protected RecordHeader getRecordHeader(Persistence obj) throws java.io.IOException
obj
-
java.io.IOException
public java.util.Iterator iterator() throws java.io.IOException
java.io.IOException
public void associate(Persistence obj, RecordHeader header)
obj
- header
- public void lock() throws java.io.IOException
java.io.IOException
public void releaseLock() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public void save(Persistence obj, byte[] data) throws QueryException
obj
- data
-
QueryException
public void delete(Persistence obj) throws QueryException
obj
-
QueryException
public void appendObject(Persistence obj, byte[] data) throws java.io.IOException
obj
- data
-
java.io.IOException
protected void initialize(java.lang.String aFileName)
aFileName
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |