public class FileResourceManager extends Object implements ResourceManager, ResourceManagerErrorCodes
toString
.
More specifically, they will have to resolve to a valid file path that does note denote a directory.
If it does, you might be able to create it, but not to read or write anything
from resp. to it. Valid string representations of a resource idenfier are
for example "file" "/root" or "hjfhdfhuhuhsdufhdsufhdsufhdfuhdfduhduhduhdu".
Invalid are for example "/" or "/root/". Invalid on some file systems are for example "c:" or "file://huhu".
Caution:
The txId
passed to many methods as an identifier for the
transaction concerned will function as a key in a HashMap
.
Thus assure that equals
and hashCode
are both
properly implemented and match each other.
Caution:
You will have to guarantee that no other process will access neither
the store or the working dir concurrently to this FileResourceManager
.
Special Caution:
Be very careful not to have two instances of FileResourceManager
working in the same store and/or working dir.
Modifier and Type | Class and Description |
---|---|
protected class |
FileResourceManager.TransactionContext
Inner class to hold the complete context, i.e.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
cleanUp |
protected static String |
CONTEXT_FILE |
protected boolean |
debug |
protected static int |
DEFAULT_COMMIT_TIMEOUT_FACTOR |
protected static int |
DEFAULT_ISOLATION_LEVEL |
protected static String |
DEFAULT_PARAMETER_ENCODING |
protected static int |
DEFAULT_TIMEOUT_MSECS |
protected long |
defaultTimeout |
protected boolean |
dirty |
protected List |
globalOpenResources |
protected Map |
globalTransactions |
protected int |
idCnt |
protected ResourceIdToPathMapper |
idMapper |
protected static int |
LOCK_ACCESS |
protected static int |
LOCK_COMMIT |
protected static int |
LOCK_EXCLUSIVE |
protected static int |
LOCK_SHARED |
protected LockManager2 |
lockManager |
protected LoggerFacade |
logger |
protected static int |
NATIVE_ISOLATION_LEVEL |
protected static int |
NO_LOCK |
protected static int |
OPERATION_MODE_RECOVERING |
protected static int |
OPERATION_MODE_STARTED |
protected static int |
OPERATION_MODE_STARTING |
protected static int |
OPERATION_MODE_STOPPED |
protected static int |
OPERATION_MODE_STOPPING |
protected int |
operationMode |
protected String |
storeDir |
protected TransactionIdToPathMapper |
txIdMapper |
protected static String |
WORK_CHANGE_DIR |
protected static String |
WORK_DELETE_DIR |
protected String |
workDir |
ISOLATION_LEVEL_READ_COMMITTED, ISOLATION_LEVEL_READ_UNCOMMITTED, ISOLATION_LEVEL_REPEATABLE_READ, ISOLATION_LEVEL_SERIALIZABLE, PREPARE_FAILURE, PREPARE_SUCCESS, PREPARE_SUCCESS_READONLY, SHUTDOWN_MODE_KILL, SHUTDOWN_MODE_NORMAL, SHUTDOWN_MODE_ROLLBACK
STATUS_ACTIVE, STATUS_COMMITTED, STATUS_COMMITTING, STATUS_MARKED_ROLLBACK, STATUS_NO_TRANSACTION, STATUS_PREPARED, STATUS_PREPARING, STATUS_ROLLEDBACK, STATUS_ROLLING_BACK, STATUS_UNKNOWN
ERR_DEAD_LOCK, ERR_DUP_TX, ERR_ISOLATION_LEVEL_UNSUPPORTED, ERR_LOCK, ERR_MARKED_FOR_ROLLBACK, ERR_NO_LOCK, ERR_NO_SUCH_RESOURCE, ERR_NO_TX, ERR_RESOURCE_EXISTS, ERR_RESOURCEID_INVALID, ERR_SYSTEM, ERR_SYSTEM_INCONSISTENT, ERR_THREAD_INVALID, ERR_TX_INACTIVE, ERR_TX_INCONSISTENT, ERR_TXID_INVALID, ERR_UNKNOWN
Constructor and Description |
---|
FileResourceManager(String storeDir,
String workDir,
boolean urlEncodePath,
LoggerFacade logger)
Creates a new resource manager operation on the specified directories.
|
FileResourceManager(String storeDir,
String workDir,
boolean urlEncodePath,
LoggerFacade logger,
boolean debug)
Creates a new resource manager operation on the specified directories.
|
FileResourceManager(String storeDir,
String workDir,
ResourceIdToPathMapper idMapper,
LoggerFacade logger,
boolean debug)
Creates a new resource manager operation on the specified directories.
|
FileResourceManager(String storeDir,
String workDir,
ResourceIdToPathMapper idMapper,
TransactionIdToPathMapper txIdMapper,
LoggerFacade logger,
boolean debug)
Creates a new resource manager operation on the specified directories.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
applyDeletes(File removeDir,
File targetDir,
File rootDir) |
protected String |
assureLeadingSlash(Object pathObject) |
protected void |
assureNotMarkedForRollback(FileResourceManager.TransactionContext context) |
protected void |
assureRMReady() |
protected void |
assureStarted() |
protected void |
closeOpenResource(Object openResource) |
void |
commitTransaction(Object txId)
Commis the transaction specified by the given transaction identifier.
|
void |
copyResource(Object txId,
Object fromResourceId,
Object toResourceId,
boolean overwrite) |
void |
createResource(Object txId,
Object resourceId)
Creates a resource.
|
void |
createResource(Object txId,
Object resourceId,
boolean assureOnly)
Creates a resource.
|
void |
deleteResource(Object txId,
Object resourceId)
Deletes a resource.
|
void |
deleteResource(Object txId,
Object resourceId,
boolean assureOnly)
Deletes a resource.
|
protected void |
fileInitialSaneCheck(Object txId,
Object path) |
String |
generatedUniqueTxId()
Generates a transaction identifier unique to this resource manager.
|
protected String |
getChangePath(Object txId,
Object path) |
protected FileResourceManager.TransactionContext |
getContext(Object txId) |
int |
getDefaultIsolationLevel()
Gets the default isolation level as an integer.
|
long |
getDefaultTransactionTimeout()
Gets the default transaction timeout in milliseconds.
|
protected String |
getDeletePath(Object txId,
Object path) |
int |
getIsolationLevel(Object txId)
Gets the isolation level for the specified transaction.
|
LoggerFacade |
getLogger()
Gets the logger used by this resource manager.
|
protected String |
getMainPath(Object path) |
protected String |
getPathForRead(Object txId,
Object resourceId) |
protected String |
getPathForWrite(Object txId,
Object resourceId) |
protected int |
getSharedLockLevel(FileResourceManager.TransactionContext context) |
String |
getStoreDir()
Gets the store directory.
|
int[] |
getSupportedIsolationLevels()
Gets an array of all isolation levels supported by this resource manager.
|
protected String |
getTransactionBaseDir(Object txId) |
int |
getTransactionState(Object txId)
Gets the state of the transaction specified by the given transaction identifier.
|
long |
getTransactionTimeout(Object txId)
Gets the transaction timeout of the specified transaction in milliseconds.
|
String |
getWorkDir()
Gets the working directory.
|
boolean |
isIsolationLevelSupported(int level)
Tests if the specified isolation level is supported by this resource manager.
|
boolean |
lockResource(Object resourceId,
Object txId)
Explicitly locks a resource exclusively, i.e.
|
boolean |
lockResource(Object resourceId,
Object txId,
boolean shared)
Explicitly locks a resource in reentrant style.
|
boolean |
lockResource(Object resourceId,
Object txId,
boolean shared,
boolean wait,
long timeoutMSecs,
boolean reentrant)
Explicitly locks a resource.
|
void |
markTransactionForRollback(Object txId)
Marks the transaction specified by the given transaction identifier for rollback.
|
void |
moveResource(Object txId,
Object fromResourceId,
Object toResourceId,
boolean overwrite) |
int |
prepareTransaction(Object txId)
Prepares the transaction specified by the given transaction identifier for commit.
|
InputStream |
readResource(Object resourceId)
Opens a streamable resource for a single reading request not inside the scope of a transaction.
|
InputStream |
readResource(Object txId,
Object resourceId)
Opens a streamable resource for reading.
|
boolean |
recover()
Tries to bring this resource manager back to a consistent state.
|
protected void |
recoverContexts() |
protected void |
registerOpenResource(Object openResource) |
protected void |
releaseGlobalOpenResources() |
void |
reset()
Resets the store by deleting work and store directory.
|
boolean |
resourceExists(Object resourceId)
Checks if a resource exists wihtout being in a transaction.
|
boolean |
resourceExists(Object txId,
Object resourceId)
Checks if a resource exists.
|
protected boolean |
rollBackOrForward() |
void |
rollbackTransaction(Object txId)
Rolls back the transaction specified by the given transaction identifier.
|
void |
setDefaultTransactionTimeout(long timeout)
Sets the default transaction timeout.
|
protected void |
setDirty(Object txId,
Throwable t) |
void |
setIsolationLevel(Object txId,
int level)
Sets the isolation level for the specified transaction.
|
void |
setTransactionTimeout(Object txId,
long mSecs)
Sets the transaction timeout of the specified transaction in milliseconds.
|
protected boolean |
shutdown(int mode,
long timeoutMSecs) |
void |
start()
Starts this resource manager.
|
void |
startTransaction(Object txId)
Creates and starts a transaction using the specified transaction identifier.
|
boolean |
stop(int mode)
Tries to stop this resource manager within a default timeout.
|
boolean |
stop(int mode,
long timeOut)
Tries to stop this resource manager within the given timeout.
|
void |
sync()
Synchronizes persistent data with caches.
|
protected FileResourceManager.TransactionContext |
txInitialSaneCheck(Object txId) |
protected FileResourceManager.TransactionContext |
txInitialSaneCheckForWriting(Object txId) |
protected boolean |
undoScheduledChangeOrCreate(Object txId,
Object resourceId) |
protected boolean |
undoScheduledDelete(Object txId,
Object resourceId) |
protected boolean |
waitForAllTxToStop(long timeoutMSecs) |
OutputStream |
writeResource(Object txId,
Object resourceId)
Opens a resource for writing.
|
OutputStream |
writeResource(Object txId,
Object resourceId,
boolean append) |
protected static final int NATIVE_ISOLATION_LEVEL
protected static final int DEFAULT_ISOLATION_LEVEL
protected static final int NO_LOCK
protected static final int LOCK_ACCESS
protected static final int LOCK_SHARED
protected static final int LOCK_EXCLUSIVE
protected static final int LOCK_COMMIT
protected static final int OPERATION_MODE_STOPPED
protected static final int OPERATION_MODE_STOPPING
protected static final int OPERATION_MODE_STARTED
protected static final int OPERATION_MODE_STARTING
protected static final int OPERATION_MODE_RECOVERING
protected static final String DEFAULT_PARAMETER_ENCODING
protected static final int DEFAULT_TIMEOUT_MSECS
protected static final int DEFAULT_COMMIT_TIMEOUT_FACTOR
protected static final String WORK_CHANGE_DIR
protected static final String WORK_DELETE_DIR
protected static final String CONTEXT_FILE
protected boolean cleanUp
protected boolean dirty
protected int operationMode
protected long defaultTimeout
protected boolean debug
protected LoggerFacade logger
protected Map globalTransactions
protected List globalOpenResources
protected LockManager2 lockManager
protected ResourceIdToPathMapper idMapper
protected TransactionIdToPathMapper txIdMapper
protected int idCnt
public FileResourceManager(String storeDir, String workDir, boolean urlEncodePath, LoggerFacade logger)
storeDir
- directory where main data should go after commitworkDir
- directory where transactions store temporary dataurlEncodePath
- if set to true
encodes all paths to allow for any kind of characterslogger
- the logger to be used by this storepublic FileResourceManager(String storeDir, String workDir, boolean urlEncodePath, LoggerFacade logger, boolean debug)
storeDir
- directory where main data should go after commitworkDir
- directory where transactions store temporary dataurlEncodePath
- if set to true
encodes all paths to allow for any kind of characterslogger
- the logger to be used by this storedebug
- if set to true
logs all locking information to "transaction.log" for debugging inspectionpublic FileResourceManager(String storeDir, String workDir, ResourceIdToPathMapper idMapper, LoggerFacade logger, boolean debug)
storeDir
- directory where main data should go after commitworkDir
- directory where transactions store temporary dataidMapper
- mapper for resourceId to pathlogger
- the logger to be used by this storedebug
- if set to true
logs all locking information to "transaction.log" for debugging inspectionpublic FileResourceManager(String storeDir, String workDir, ResourceIdToPathMapper idMapper, TransactionIdToPathMapper txIdMapper, LoggerFacade logger, boolean debug)
storeDir
- directory where main data should go after commitworkDir
- directory where transactions store temporary dataidMapper
- mapper for resourceId to pathtxIdMapper
- mapper for transaction id to pathlogger
- the logger to be used by this storedebug
- if set to true
logs all locking information to "transaction.log" for debugging inspectionprotected static void applyDeletes(File removeDir, File targetDir, File rootDir) throws IOException
IOException
public String getStoreDir()
FileResourceManager(String, String, boolean, LoggerFacade)
,
FileResourceManager(String, String, boolean, LoggerFacade, boolean)
public String getWorkDir()
FileResourceManager(String, String, boolean, LoggerFacade)
,
FileResourceManager(String, String, boolean, LoggerFacade, boolean)
public LoggerFacade getLogger()
public boolean lockResource(Object resourceId, Object txId) throws ResourceManagerException
ResourceManager
lockResource
in interface ResourceManager
resourceId
- identifier for the resource to be lockedtxId
- identifier for the transaction that tries to acquire a lockResourceManagerException
- if an error occuredResourceManager.lockResource(Object, Object, boolean)
,
ResourceManager.lockResource(Object, Object, boolean, boolean, long, boolean)
public boolean lockResource(Object resourceId, Object txId, boolean shared) throws ResourceManagerException
ResourceManager
lockResource
in interface ResourceManager
resourceId
- identifier for the resource to be lockedtxId
- identifier for the transaction that tries to acquire a lockshared
- true
if this lock may be shared by other shared locksResourceManagerException
- if an error occuredResourceManager.lockResource(Object, Object, boolean, boolean, long, boolean)
public boolean lockResource(Object resourceId, Object txId, boolean shared, boolean wait, long timeoutMSecs, boolean reentrant) throws ResourceManagerException
ResourceManager
txId
does not come first) is different than in other methods of this interface.
This is done to make clear locking affects all transactions, not only the locking one.
This should be clear anyhow, but seems to be worth noting.lockResource
in interface ResourceManager
resourceId
- identifier for the resource to be lockedtxId
- identifier for the transaction that tries to acquire a lockshared
- true
if this lock may be shared by other shared lockswait
- true
if the method shall block when lock can not be acquired nowtimeoutMSecs
- timeout in millisecondsreentrant
- true
if the lock should be acquired even when the requesting transaction and no other holds an incompatible locktrue
when the lock has been acquiredResourceManagerException
- if an error occuredpublic int getDefaultIsolationLevel()
ResourceManager
getDefaultIsolationLevel
in interface ResourceManager
ResourceManager.ISOLATION_LEVEL_READ_UNCOMMITTED
,
ResourceManager.ISOLATION_LEVEL_READ_COMMITTED
, ResourceManager.ISOLATION_LEVEL_REPEATABLE_READ
or ResourceManager.ISOLATION_LEVEL_SERIALIZABLE
or any other int representing an isolation levelpublic int[] getSupportedIsolationLevels() throws ResourceManagerException
ResourceManager
null
or empty as every resource manager has some sort of isolation level.getSupportedIsolationLevels
in interface ResourceManager
ResourceManager.ISOLATION_LEVEL_READ_UNCOMMITTED
,
ResourceManager.ISOLATION_LEVEL_READ_COMMITTED
, ResourceManager.ISOLATION_LEVEL_REPEATABLE_READ
or ResourceManager.ISOLATION_LEVEL_SERIALIZABLE
or any other int representing an isolation levelResourceManagerException
- if an error occuredResourceManager.getDefaultIsolationLevel()
public boolean isIsolationLevelSupported(int level) throws ResourceManagerException
ResourceManager
isIsolationLevelSupported
in interface ResourceManager
level
- isolation level whose support is to be testedtrue
if the isolation level is supportedResourceManagerException
- if an error occuredResourceManager.getDefaultIsolationLevel()
public long getDefaultTransactionTimeout()
getDefaultTransactionTimeout
in interface ResourceManager
public void setDefaultTransactionTimeout(long timeout)
timeout
- timeout in millisecondspublic long getTransactionTimeout(Object txId) throws ResourceManagerException
ResourceManager
getTransactionTimeout
in interface ResourceManager
txId
- identifier for the concerned transactionResourceManagerException
- if an error occuredResourceManager.getDefaultTransactionTimeout()
public void setTransactionTimeout(Object txId, long mSecs) throws ResourceManagerException
ResourceManager
setTransactionTimeout
in interface ResourceManager
txId
- identifier for the concerned transactionmSecs
- transaction timeout of the specified transaction in millisecondsResourceManagerException
- if an error occuredResourceManager.getDefaultTransactionTimeout()
public int getIsolationLevel(Object txId) throws ResourceManagerException
ResourceManager
getIsolationLevel
in interface ResourceManager
txId
- identifier for the concerned transactionResourceManager.ISOLATION_LEVEL_READ_UNCOMMITTED
,
ResourceManager.ISOLATION_LEVEL_READ_COMMITTED
, ResourceManager.ISOLATION_LEVEL_REPEATABLE_READ
or ResourceManager.ISOLATION_LEVEL_SERIALIZABLE
or any other int representing an isolation levelResourceManagerException
- if an error occuredResourceManager.getDefaultIsolationLevel()
public void setIsolationLevel(Object txId, int level) throws ResourceManagerException
ResourceManager
setIsolationLevel
in interface ResourceManager
txId
- identifier for the concerned transactionlevel
- one of the predefined isolation levels ResourceManager.ISOLATION_LEVEL_READ_UNCOMMITTED
,
ResourceManager.ISOLATION_LEVEL_READ_COMMITTED
, ResourceManager.ISOLATION_LEVEL_REPEATABLE_READ
or ResourceManager.ISOLATION_LEVEL_SERIALIZABLE
or any other int representing an isolation levelResourceManagerException
- if an error occuredResourceManager.getDefaultIsolationLevel()
public void start() throws ResourceManagerSystemException
ResourceManager
start
in interface ResourceManager
ResourceManagerSystemException
- if start failed due to internal problemspublic boolean stop(int mode) throws ResourceManagerSystemException
ResourceManager
stop
in interface ResourceManager
mode
- one of predefined shutdown modes ResourceManager.SHUTDOWN_MODE_NORMAL
, ResourceManager.SHUTDOWN_MODE_ROLLBACK
or ResourceManager.SHUTDOWN_MODE_KILL
or any other int representing a shutdown modetrue
if resource manager stopped within given timeoutResourceManagerSystemException
- if anything fatal hapened during shutdownpublic boolean stop(int mode, long timeOut) throws ResourceManagerSystemException
ResourceManager
stop
in interface ResourceManager
mode
- one of ResourceManager.SHUTDOWN_MODE_NORMAL
, ResourceManager.SHUTDOWN_MODE_ROLLBACK
or ResourceManager.SHUTDOWN_MODE_KILL
timeOut
- timeout for shutdown in millisecondstrue
if resource manager stopped within given timeoutResourceManagerSystemException
- if something fatal hapened during shutdownpublic boolean recover() throws ResourceManagerSystemException
ResourceManager
recover
in interface ResourceManager
true
upon successful recovery of the resource managerResourceManagerSystemException
- if anything fatal hapened during recoverypublic int getTransactionState(Object txId) throws ResourceManagerException
ResourceManager
int
code as defined
in the Status
interface.getTransactionState
in interface ResourceManager
txId
- identifier for the transaction for which the state is returnedStatus
ResourceManagerException
- if an error occuredpublic void startTransaction(Object txId) throws ResourceManagerException
ResourceManager
startTransaction
in interface ResourceManager
txId
- identifier for the transaction to be startedResourceManagerException
- if an error occuredpublic void markTransactionForRollback(Object txId) throws ResourceManagerException
ResourceManager
rollback
is permitted.markTransactionForRollback
in interface ResourceManager
txId
- identifier for the transaction to be marked for rollbackResourceManagerException
- if an error occuredpublic int prepareTransaction(Object txId) throws ResourceManagerException
ResourceManager
ResourceManager.PREPARE_SUCCESS
),
succeed as there is nothing to commit (ResourceManager.PREPARE_SUCCESS_READONLY
)
or fail (ResourceManager.PREPARE_FAILURE
). If the preparation fails, commit will
fail as well and the transaction should be marked for rollback. However, if it
succeeds the resource manager must guarantee that a following commit will succeed as well.
prepareTransaction
in interface ResourceManager
txId
- identifier for the transaction to be preparedResourceManager.PREPARE_SUCCESS
, ResourceManager.PREPARE_SUCCESS_READONLY
or ResourceManager.PREPARE_FAILURE
ResourceManagerException
- alternative way to signal prepare failedpublic void rollbackTransaction(Object txId) throws ResourceManagerException
ResourceManager
rollbackTransaction
in interface ResourceManager
txId
- identifier for the transaction to be rolled backResourceManagerException
- if an error occuredpublic void commitTransaction(Object txId) throws ResourceManagerException
ResourceManager
commitTransaction
in interface ResourceManager
txId
- identifier for the transaction to be committedResourceManagerException
- if an error occuredpublic boolean resourceExists(Object resourceId) throws ResourceManagerException
ResourceManager
resourceExists
in interface ResourceManager
resourceId
- identifier for the resource to check fortrue
if the resource existsResourceManagerException
- if an error occuredpublic boolean resourceExists(Object txId, Object resourceId) throws ResourceManagerException
ResourceManager
resourceExists
in interface ResourceManager
txId
- identifier for the transaction in which the resource is to be checked forresourceId
- identifier for the resource to check fortrue
if the resource existsResourceManagerException
- if an error occuredpublic void deleteResource(Object txId, Object resourceId) throws ResourceManagerException
ResourceManager
deleteResource
in interface ResourceManager
txId
- identifier for the transaction in which the resource is to be deletedresourceId
- identifier for the resource to be deletedResourceManagerException
- if the resource does not exist or any other error occuredpublic void deleteResource(Object txId, Object resourceId, boolean assureOnly) throws ResourceManagerException
ResourceManager
deleteResource
in interface ResourceManager
txId
- identifier for the transaction in which the resource is to be deletedresourceId
- identifier for the resource to be deletedassureOnly
- if set to true
this method will not throw an exception when the resource does not existResourceManagerException
- if the resource does not exist and assureOnly
was not set to true
or any other error occuredpublic void createResource(Object txId, Object resourceId) throws ResourceManagerException
ResourceManager
createResource
in interface ResourceManager
txId
- identifier for the transaction in which the resource is to be createdresourceId
- identifier for the resource to be createdResourceManagerException
- if the resource already exist or any other error occuredpublic void createResource(Object txId, Object resourceId, boolean assureOnly) throws ResourceManagerException
ResourceManager
createResource
in interface ResourceManager
txId
- identifier for the transaction in which the resource is to be createdresourceId
- identifier for the resource to be createdassureOnly
- if set to true
this method will not throw an exception when the resource already existsResourceManagerException
- if the resource already exists and assureOnly
was not set to true
or any other error occuredpublic void copyResource(Object txId, Object fromResourceId, Object toResourceId, boolean overwrite) throws ResourceManagerException
ResourceManagerException
public void moveResource(Object txId, Object fromResourceId, Object toResourceId, boolean overwrite) throws ResourceManagerException
ResourceManagerException
public InputStream readResource(Object resourceId) throws ResourceManagerException
ResourceManager
readResource
in interface ResourceManager
resourceId
- identifier for the streamable resource to be openedResourceManagerException
- if the resource does not exist or any other error occuredpublic InputStream readResource(Object txId, Object resourceId) throws ResourceManagerException
ResourceManager
readResource
in interface ResourceManager
txId
- identifier for the transaction in which the streamable resource is to be openendresourceId
- identifier for the streamable resource to be openedResourceManagerException
- if the resource does not exist or any other error occuredpublic OutputStream writeResource(Object txId, Object resourceId) throws ResourceManagerException
ResourceManager
writeResource
in interface ResourceManager
txId
- identifier for the transaction in which the streamable resource is to be openendresourceId
- identifier for the streamable resource to be openedResourceManagerException
- if the resource does not exist or any other error occuredpublic OutputStream writeResource(Object txId, Object resourceId, boolean append) throws ResourceManagerException
ResourceManagerException
public void reset()
public void sync() throws ResourceManagerSystemException
ResourceManagerSystemException
- if anything fatal hapened during synchonizationpublic String generatedUniqueTxId() throws ResourceManagerSystemException
ResourceManagerSystemException
- if this resource manager has not been started, yetprotected void fileInitialSaneCheck(Object txId, Object path) throws ResourceManagerException
ResourceManagerException
protected void assureStarted() throws ResourceManagerSystemException
ResourceManagerSystemException
protected void assureRMReady() throws ResourceManagerSystemException
ResourceManagerSystemException
protected void assureNotMarkedForRollback(FileResourceManager.TransactionContext context) throws ResourceManagerException
ResourceManagerException
protected FileResourceManager.TransactionContext txInitialSaneCheckForWriting(Object txId) throws ResourceManagerException
ResourceManagerException
protected FileResourceManager.TransactionContext txInitialSaneCheck(Object txId) throws ResourceManagerException
ResourceManagerException
protected FileResourceManager.TransactionContext getContext(Object txId)
protected String assureLeadingSlash(Object pathObject)
protected String getMainPath(Object path)
protected String getTransactionBaseDir(Object txId)
protected String getChangePath(Object txId, Object path)
protected String getDeletePath(Object txId, Object path)
protected boolean undoScheduledDelete(Object txId, Object resourceId) throws ResourceManagerException
ResourceManagerException
protected boolean undoScheduledChangeOrCreate(Object txId, Object resourceId) throws ResourceManagerException
ResourceManagerException
protected String getPathForWrite(Object txId, Object resourceId) throws ResourceManagerException
ResourceManagerException
protected String getPathForRead(Object txId, Object resourceId) throws ResourceManagerException
ResourceManagerException
protected int getSharedLockLevel(FileResourceManager.TransactionContext context) throws ResourceManagerException
ResourceManagerException
protected void registerOpenResource(Object openResource)
protected void releaseGlobalOpenResources()
protected void closeOpenResource(Object openResource)
protected boolean rollBackOrForward()
protected void recoverContexts()
protected boolean waitForAllTxToStop(long timeoutMSecs)
protected boolean shutdown(int mode, long timeoutMSecs)
Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.