use of com.arjuna.ats.internal.txoj.lockstore.BasicPersistentLockStore in project narayana by jbosstm.
the class LockManager method initialise.
/*
* Don't need to protect with a synchronization as this routine can only be
* called from within other protected methods. Only called if multiple
* object model is used.
*/
protected final boolean initialise() {
if (txojLogger.logger.isTraceEnabled()) {
txojLogger.logger.trace("LockManager::initialise()");
}
boolean result = false;
if (systemKey == null) {
systemKey = type();
if (mutex != null) {
mutex.lock();
if (lockStore == null) {
try {
if (lockStoreType.equals(BasicLockStore.class.getName())) {
lockStore = new BasicLockStore();
} else {
ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean();
objectStoreEnvironmentBean.setLocalOSRoot(systemKey);
lockStore = new BasicPersistentLockStore(objectStoreEnvironmentBean);
}
} catch (final Exception ex) {
lockStore = null;
}
}
mutex.unlock();
}
}
result = (lockStore != null);
return result;
}
Aggregations