org.apache.commons.transaction.file
Class TxFileResourceManager
java.lang.Object
org.apache.commons.transaction.AbstractTransactionalResourceManager<TxFileResourceManager.FileTxContext>
org.apache.commons.transaction.file.TxFileResourceManager
- All Implemented Interfaces:
- ManageableResourceManager, ResourceManager<StreamableResource>, TransactionalResourceManager
public class TxFileResourceManager
- extends AbstractTransactionalResourceManager<TxFileResourceManager.FileTxContext>
- implements ManageableResourceManager, ResourceManager<StreamableResource>
Transactional file system implementation of a
resource manager.
All meaningful actions that ensure ACID transactions are delegated to special
components. This allows for customization of all kinds:
This implementation is thread-safe.
- See Also:
FileResourceUndoManager,
ResourceManager,
HierarchicalLockManager,
LockManager
| Methods inherited from class org.apache.commons.transaction.AbstractTransactionalResourceManager |
commitTransaction, forgetTransaction, getActiveTx, getCheckedActiveTx, getLm, getName, isPartofComplexTransaction, isReadOnly, isRollbackOnly, joinTransaction, prepareTransaction, rollbackTransaction, setActiveTx, setName, startTransaction |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
wrapped
protected FileResourceManager wrapped
undoManager
protected FileResourceUndoManager undoManager
hlm
protected HierarchicalLockManager hlm
TxFileResourceManager
public TxFileResourceManager(String name,
String rootPath)
setLm
public void setLm(LockManager<Object,Object> lm)
- Overrides:
setLm in class AbstractTransactionalResourceManager<TxFileResourceManager.FileTxContext>
commitCanFail
public boolean commitCanFail()
- Description copied from interface:
ManageableResourceManager
- Checks whether a tried commit could possibly fail because of logical
reasons.
- Specified by:
commitCanFail in interface ManageableResourceManager- Specified by:
commitCanFail in class AbstractTransactionalResourceManager<TxFileResourceManager.FileTxContext>
- Returns:
true if a commit could fail
getResource
public FileResourceManager.FileResource getResource(String path)
throws ResourceException
- Description copied from interface:
ResourceManager
- Gets the resource denoted by the path
- Specified by:
getResource in interface ResourceManager<StreamableResource>
- Parameters:
path - the path of the resource
- Returns:
- the resource denoted by the path
- Throws:
ResourceException - in case anything goes fatally wrong
getRootPath
public String getRootPath()
- Description copied from interface:
ResourceManager
- Gets the root path of this manager.
- Specified by:
getRootPath in interface ResourceManager<StreamableResource>
- Returns:
- the root path or
null if no applicable
setUndoManager
public void setUndoManager(FileResourceUndoManager undoManager)
createContext
protected TxFileResourceManager.FileTxContext createContext()
- Specified by:
createContext in class AbstractTransactionalResourceManager<TxFileResourceManager.FileTxContext>
getHLM
protected HierarchicalLockManager getHLM()
getUndoManager
protected FileResourceUndoManager getUndoManager()
Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.