|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Transaction
The Transaction interface defines the API of the atomic storage component.
Field Summary | |
---|---|
static int |
COMMIT
|
static int |
FINALIZE
|
static int |
FREE
|
static int |
GARBAGE
|
static int |
INIT
|
static int |
Kb
|
static int |
Mb
|
static java.lang.String[] |
PhaseInfo
|
static int |
ROLLBACK
|
static int |
RUN
|
Method Summary | |
---|---|
void |
begin()
Start a transaction validation, the validation phase needs 3 phases: begin, commit and release. |
void |
close()
Close the transaction module. |
void |
commit(boolean release)
Commit the current transaction. |
void |
create(java.io.Serializable obj,
java.lang.String name)
Register the state of a newly created object in the current transaction. |
void |
create(java.io.Serializable obj,
java.lang.String dirName,
java.lang.String name)
Register the state of a newly created object in the current transaction. |
void |
createByteArray(byte[] buf,
java.lang.String name)
Register a new byte array in the current transaction. |
void |
createByteArray(byte[] buf,
java.lang.String dirName,
java.lang.String name)
Register a new byte array in the current transaction. |
void |
delete(java.lang.String name)
Deletes the specified object. |
void |
delete(java.lang.String dirName,
java.lang.String name)
Deletes the specified object. |
java.lang.String[] |
getList(java.lang.String prefix)
Returns an array of strings naming the objects in the component started by this prefix. |
int |
getPhase()
Returns the transaction state. |
java.lang.String |
getPhaseInfo()
Returns a string representation of the transaction state. |
void |
init(java.lang.String path)
Initializes the atomic storage component. |
boolean |
isPersistent()
Returns true if the component is persistent. |
java.lang.Object |
load(java.lang.String name)
Load the specified object. |
java.lang.Object |
load(java.lang.String dirName,
java.lang.String name)
Load the specified object. |
byte[] |
loadByteArray(java.lang.String name)
Load the specified byte array. |
byte[] |
loadByteArray(java.lang.String dirName,
java.lang.String name)
Load the specified byte array. |
void |
release()
Release the mutual exclusion. |
void |
save(java.io.Serializable obj,
java.lang.String name)
Register the modified state of an object in the current transaction. |
void |
save(java.io.Serializable obj,
java.lang.String dirName,
java.lang.String name)
Register the modified state of an object in the current transaction. |
void |
save(java.io.Serializable obj,
java.lang.String dirName,
java.lang.String name,
boolean first)
Register the state of an object in the current transaction. |
void |
saveByteArray(byte[] buf,
java.lang.String name)
Register a modified byte array in the current transaction. |
void |
saveByteArray(byte[] buf,
java.lang.String dirName,
java.lang.String name)
Register a modified byte array in the current transaction. |
void |
saveByteArray(byte[] buf,
java.lang.String dirName,
java.lang.String name,
boolean copy,
boolean first)
Register a modified byte array in the current transaction. |
void |
stop()
Stops the transaction module. |
Field Detail |
---|
static final int INIT
static final int FREE
static final int RUN
static final int COMMIT
static final int ROLLBACK
static final int GARBAGE
static final int FINALIZE
static final java.lang.String[] PhaseInfo
static final int Kb
static final int Mb
Method Detail |
---|
void init(java.lang.String path) throws java.io.IOException
path
-
java.io.IOException
int getPhase()
java.lang.String getPhaseInfo()
void begin() throws java.io.IOException
java.io.IOException
java.lang.String[] getList(java.lang.String prefix)
prefix
-
boolean isPersistent()
void create(java.io.Serializable obj, java.lang.String name) throws java.io.IOException
obj
- the object to store.name
- the name of the object.
java.io.IOException
void create(java.io.Serializable obj, java.lang.String dirName, java.lang.String name) throws java.io.IOException
obj
- the object to store.dirName
- the directory name of the object.name
- the name of the object.
java.io.IOException
void save(java.io.Serializable obj, java.lang.String name) throws java.io.IOException
obj
- the object to store.name
- the name of the object.
java.io.IOException
void save(java.io.Serializable obj, java.lang.String dirName, java.lang.String name) throws java.io.IOException
obj
- the object to store.dirName
- the directory name of the object.name
- the name of the object.
java.io.IOException
void save(java.io.Serializable obj, java.lang.String dirName, java.lang.String name, boolean first) throws java.io.IOException
obj
- the object to store.dirName
- the directory name of the object.name
- the name of the object.first
- the object is a new one.
java.io.IOException
void createByteArray(byte[] buf, java.lang.String name) throws java.io.IOException
buf
- the byte array to store.name
- the name of the object.
java.io.IOException
void createByteArray(byte[] buf, java.lang.String dirName, java.lang.String name) throws java.io.IOException
buf
- the byte array to store.dirName
- the directory name of the object.name
- the name of the object.
java.io.IOException
void saveByteArray(byte[] buf, java.lang.String name) throws java.io.IOException
buf
- the byte array to store.name
- the name of the object.
java.io.IOException
void saveByteArray(byte[] buf, java.lang.String dirName, java.lang.String name) throws java.io.IOException
buf
- the byte array to store.dirName
- the directory name of the object.name
- the name of the object.
java.io.IOException
void saveByteArray(byte[] buf, java.lang.String dirName, java.lang.String name, boolean copy, boolean first) throws java.io.IOException
buf
- the byte array to store.dirName
- the directory name of the object.name
- the name of the object.copy
- the byte array can be modified, copy it.first
- the object is a new one.
java.io.IOException
java.lang.Object load(java.lang.String name) throws java.io.IOException, java.lang.ClassNotFoundException
name
- the name of the object.
java.io.IOException
java.lang.ClassNotFoundException
java.lang.Object load(java.lang.String dirName, java.lang.String name) throws java.io.IOException, java.lang.ClassNotFoundException
dirName
- the directory name of the object.name
- the name of the object.
java.io.IOException
java.lang.ClassNotFoundException
byte[] loadByteArray(java.lang.String name) throws java.io.IOException, java.lang.ClassNotFoundException
name
- the name of the object.
java.io.IOException
java.lang.ClassNotFoundException
byte[] loadByteArray(java.lang.String dirName, java.lang.String name) throws java.io.IOException
dirName
- the directory name of the object.name
- the name of the object.
java.io.IOException
void delete(java.lang.String name)
name
- the name of the object.void delete(java.lang.String dirName, java.lang.String name)
dirName
- the directory name of the object.name
- the name of the object.void commit(boolean release) throws java.io.IOException
release
- if true releases the transaction at the end of the commit.
java.io.IOException
void release() throws java.io.IOException
java.io.IOException
void stop()
void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |