|
Home | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xl2.odb.XL2Database
A network of serialized objects accessible from a single root object.
Files
An XL2 database is a directory containing of several files.
Usage
Closing
Database Daemon
XL2Transaction
Field Summary | |
static int |
NOT_OPEN
Open mode. |
static int |
OPEN_READ_ONLY
Open mode. |
static int |
OPEN_READ_WRITE
Open mode. |
Constructor Summary | |
XL2Database()
See open() |
Method Summary | |
void |
close()
Aborts open transactions, evicts database contents from memory, and unlocks the database. |
void |
closeException(java.lang.Exception x)
Deprecated. Replaced by log(Throwable) |
static XL2Database |
create(java.lang.String dbDir)
Creates and returns a new XL2Database that will be open for read/write. |
java.io.ObjectInput |
getObjectInput(java.io.InputStream in)
Callback for subclasses to manage serialization. |
java.io.ObjectOutput |
getObjectOutput(java.io.OutputStream out)
Callback for subclasses to manage serialization. |
int |
getOpenMode()
NOT_OPEN, OPEN_READ_ONLY, or OPEN_READ_WRITE |
java.lang.Object |
getRoot()
Returns the database entry object. |
void |
log(java.lang.String message,
java.lang.Throwable throwable)
Prints a timestamp, message and stack trace to "log.xl2" in the database directory. |
void |
newDatabase(java.lang.String dbDir)
Creates a database that will be closed upon completion of this method. |
XL2Transaction |
newTransaction()
Required to access and mutate XL2References and opened database instances. |
void |
open(java.lang.String dbDir,
int mode)
Opens the database with the given mode. |
void |
setRoot(java.lang.Object object)
Sets the database root. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NOT_OPEN
public static final int OPEN_READ_ONLY
public static final int OPEN_READ_WRITE
Constructor Detail |
public XL2Database()
Method Detail |
public void close()
public void closeException(java.lang.Exception x)
#log(Throwable)
public static XL2Database create(java.lang.String dbDir) throws XL2Exception
dbDir
- XL2Database directory.XL2Exception
- Wrapping any other exceptions.newDatabase(String)
public java.io.ObjectInput getObjectInput(java.io.InputStream in) throws XL2Exception
XL2Exception
- Wrapping any internal exception such as IOExceptions.getObjectOutput(OutputStream)
public java.io.ObjectOutput getObjectOutput(java.io.OutputStream out) throws XL2Exception
XL2Exception
- Wrapping any internal exception such as IOExceptions.getObjectInput(InputStream)
public int getOpenMode()
public java.lang.Object getRoot()
public void log(java.lang.String message, java.lang.Throwable throwable)
message
- May be null.exception
- May be null.public void newDatabase(java.lang.String dbDir) throws XL2Exception
dbDir
- XL2Database directory.XL2Exception
- Wrapping any other exceptions.public XL2Transaction newTransaction()
DatabaseNotOpenException
- public void open(java.lang.String dbDir, int mode) throws DatabaseLockedException, XL2Exception
dbDir
- The database directory.mode
- OPEN_READ_ONLY or OPEN_READ_WRITEDatabaseLockedException
- If a lock file prevents opening.XL2Exception
- Wrapping exceptions such as IOExceptions.public void setRoot(java.lang.Object object)
|
Home | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |