public final class NullTransaction extends BaseTransaction implements NullTransactionMBean
Modifier and Type | Field and Description |
---|---|
protected int |
phase |
protected long |
startTime |
logmon
Constructor and Description |
---|
NullTransaction() |
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
containsOperations()
Indicates whether some operations have been done in
this transaction.
|
void |
create(Serializable obj,
String name)
Register the state of a newly created object in the current transaction.
|
void |
create(Serializable obj,
String dirName,
String name)
Register the state of a newly created object in the current transaction.
|
void |
createByteArray(byte[] buf,
String name)
Register a new byte array in the current transaction.
|
void |
createByteArray(byte[] buf,
String dirName,
String name)
Register a new byte array in the current transaction.
|
void |
delete(String name)
Deletes the specified object.
|
void |
delete(String dirName,
String name)
Deletes the specified object.
|
File |
getDir() |
String[] |
getList(String prefix)
Returns an array of strings naming the objects in the component started by this prefix.
|
String |
getPersistenceDir()
Returns the path of persistence directory.
|
int |
getPhase()
Returns the transaction state.
|
String |
getPhaseInfo()
Returns a string representation of the transaction state.
|
long |
getStartTime()
Returns the starting time.
|
void |
init(String path)
Initializes the atomic storage component.
|
boolean |
isPersistent()
Tests if the Transaction component is persistent.
|
Object |
load(String name)
Load the specified object.
|
Object |
load(String dirName,
String name)
Load the specified object.
|
byte[] |
loadByteArray(String name)
Load the specified byte array.
|
byte[] |
loadByteArray(String dirName,
String name)
Load the specified byte array.
|
void |
release()
Release the mutual exclusion.
|
void |
save(Serializable obj,
String name)
Register the modified state of an object in the current transaction.
|
void |
save(Serializable obj,
String dirName,
String name)
Register the modified state of an object in the current transaction.
|
void |
save(Serializable obj,
String dirName,
String name,
boolean first)
Register the state of an object in the current transaction.
|
void |
saveByteArray(byte[] buf,
String name)
Register a modified byte array in the current transaction.
|
void |
saveByteArray(byte[] buf,
String dirName,
String name)
Register a modified byte array in the current transaction.
|
void |
saveByteArray(byte[] buf,
String dirName,
String name,
boolean copy,
boolean first)
Register a modified byte array in the current transaction.
|
protected void |
setPhase(int newPhase) |
void |
stop()
Stops the transaction module.
|
getBoolean, getInteger, getInteger, getProperty, getProperty, loadProperties, saveProperties
public long getStartTime()
getStartTime
in interface TransactionMBean
public final int getPhase()
Transaction
getPhase
in interface Transaction
getPhase
in interface TransactionMBean
public final String getPhaseInfo()
Transaction
getPhaseInfo
in interface Transaction
getPhaseInfo
in interface TransactionMBean
protected final void setPhase(int newPhase)
public boolean isPersistent()
isPersistent
in interface Transaction
isPersistent
in interface TransactionMBean
public void init(String path) throws IOException
Transaction
init
in interface Transaction
IOException
public File getDir()
public String getPersistenceDir()
public final void begin() throws IOException
Transaction
begin
in interface Transaction
IOException
public String[] getList(String prefix)
Transaction
getList
in interface Transaction
public final void create(Serializable obj, String name) throws IOException
Transaction
create
in interface Transaction
obj
- the object to store.name
- the name of the object.IOException
public final void create(Serializable obj, String dirName, String name) throws IOException
Transaction
create
in interface Transaction
obj
- the object to store.dirName
- the directory name of the object.name
- the name of the object.IOException
public final void save(Serializable obj, String name) throws IOException
Transaction
save
in interface Transaction
obj
- the object to store.name
- the name of the object.IOException
public final void save(Serializable obj, String dirName, String name) throws IOException
Transaction
save
in interface Transaction
obj
- the object to store.dirName
- the directory name of the object.name
- the name of the object.IOException
public void save(Serializable obj, String dirName, String name, boolean first) throws IOException
Transaction
save
in interface Transaction
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.IOException
public final void createByteArray(byte[] buf, String name) throws IOException
Transaction
createByteArray
in interface Transaction
buf
- the byte array to store.name
- the name of the object.IOException
public final void createByteArray(byte[] buf, String dirName, String name) throws IOException
Transaction
createByteArray
in interface Transaction
buf
- the byte array to store.dirName
- the directory name of the object.name
- the name of the object.IOException
public final void saveByteArray(byte[] buf, String name) throws IOException
Transaction
saveByteArray
in interface Transaction
buf
- the byte array to store.name
- the name of the object.IOException
public final void saveByteArray(byte[] buf, String dirName, String name) throws IOException
Transaction
saveByteArray
in interface Transaction
buf
- the byte array to store.dirName
- the directory name of the object.name
- the name of the object.IOException
public void saveByteArray(byte[] buf, String dirName, String name, boolean copy, boolean first) throws IOException
Transaction
saveByteArray
in interface Transaction
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.IOException
public final Object load(String name) throws IOException, ClassNotFoundException
Transaction
load
in interface Transaction
name
- the name of the object.IOException
ClassNotFoundException
public final Object load(String dirName, String name) throws IOException, ClassNotFoundException
Transaction
load
in interface Transaction
dirName
- the directory name of the object.name
- the name of the object.IOException
ClassNotFoundException
public final byte[] loadByteArray(String name) throws IOException
Transaction
loadByteArray
in interface Transaction
name
- the name of the object.IOException
public byte[] loadByteArray(String dirName, String name) throws IOException
Transaction
loadByteArray
in interface Transaction
dirName
- the directory name of the object.name
- the name of the object.IOException
public final void delete(String name)
Transaction
delete
in interface Transaction
name
- the name of the object.public void delete(String dirName, String name)
Transaction
delete
in interface Transaction
dirName
- the directory name of the object.name
- the name of the object.public void commit(boolean release) throws IOException
Transaction
commit
in interface Transaction
release
- if true releases the transaction at the end of the commit.IOException
public void release() throws IOException
Transaction
release
in interface Transaction
IOException
public final void stop()
Transaction
stop
in interface Transaction
public final void close()
Transaction
close
in interface Transaction
public boolean containsOperations()
containsOperations
in interface Transaction
Copyright © 2013 ScalAgent D.T.. All Rights Reserved.