org.apache.commons.transaction.file
Class MemoryUndoManager
java.lang.Object
org.apache.commons.transaction.file.MemoryUndoManager
- All Implemented Interfaces:
- FileResourceUndoManager
public class MemoryUndoManager
- extends Object
- implements FileResourceUndoManager
Default implementation of FileResourceUndoManager.
Undo information is held in memory only. Changed content streams are stored as temporary files.
Caution:This implementation does not guarantee ACID properties after a JVM crash.
This implementation is thread-safe.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
localRecords
protected ThreadLocal<List<MemoryUndoManager.UndoRecord>> localRecords
MemoryUndoManager
public MemoryUndoManager(String logDir)
throws IOException
- Throws:
IOException
startRecord
public void startRecord()
- Specified by:
startRecord in interface FileResourceUndoManager
undoRecord
public void undoRecord()
- Specified by:
undoRecord in interface FileResourceUndoManager
forgetRecord
public void forgetRecord()
- Specified by:
forgetRecord in interface FileResourceUndoManager
storeRecord
protected void storeRecord(MemoryUndoManager.UndoRecord record)
recordUpdate
public void recordUpdate(File file)
- Specified by:
recordUpdate in interface FileResourceUndoManager
recordUpdate
protected void recordUpdate(File file,
boolean moveAllowed)
recordCreate
public void recordCreate(File file)
- Specified by:
recordCreate in interface FileResourceUndoManager
recordDelete
public void recordDelete(File file)
- Specified by:
recordDelete in interface FileResourceUndoManager
Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.