use of com.arjuna.ats.internal.arjuna.objectstore.TwoPhaseVolatileStore in project narayana by jbosstm.
the class StateManager method setupStore.
/**
* Make sure the object store is set up, if required.
*
* @param rootName
* indicates the root of the object store.
*/
@SuppressWarnings("unchecked")
protected synchronized void setupStore(String rootName, String objectStoreType) {
if (tsLogger.logger.isTraceEnabled()) {
tsLogger.logger.trace("StateManager::setupStore ( " + ((rootName != null) ? rootName : "null") + " )");
}
if (!loadObjectState())
return;
if (participantStore != null)
return;
if (rootName == null)
rootName = arjPropertyManager.getObjectStoreEnvironmentBean().getLocalOSRoot();
if (storeRoot != null) {
if ((rootName == null) || (rootName.compareTo("") == 0) || (rootName.compareTo(storeRoot) == 0)) {
return;
}
/* No - destroy old store and create new */
participantStore = null;
}
if (rootName == null) {
rootName = "";
}
/* Create store now */
storeRoot = new String(rootName);
if ((myType == ObjectType.ANDPERSISTENT) || (myType == ObjectType.NEITHER)) {
int sharedStatus = ((objectModel == ObjectModel.SINGLE) ? StateType.OS_UNSHARED : StateType.OS_SHARED);
participantStore = StoreManager.setupStore(rootName, sharedStatus);
} else {
try {
participantStore = new TwoPhaseVolatileStore(new ObjectStoreEnvironmentBean());
} catch (final Throwable ex) {
tsLogger.i18NLogger.warn_StateManager_13();
throw new FatalError(tsLogger.i18NLogger.get_StateManager_14());
}
}
}
use of com.arjuna.ats.internal.arjuna.objectstore.TwoPhaseVolatileStore in project narayana by jbosstm.
the class ObjectStoreTest method testTypedTwoPhaseVolatileStore.
@Test
public void testTypedTwoPhaseVolatileStore() throws Exception {
ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean();
objectStoreEnvironmentBean.setLocalOSRoot("tmp");
objectStoreEnvironmentBean.setVolatileStoreSupportAllObjUids(true);
typedVolatileStoreCommon(new TwoPhaseVolatileStore(objectStoreEnvironmentBean));
}
use of com.arjuna.ats.internal.arjuna.objectstore.TwoPhaseVolatileStore in project narayana by jbosstm.
the class RawOptimisticHammerUnitTest method init.
private static synchronized void init() throws Exception {
if (!_init) {
StoreManager sm = new StoreManager(null, new TwoPhaseVolatileStore(new ObjectStoreEnvironmentBean()), null);
_init = true;
}
}
use of com.arjuna.ats.internal.arjuna.objectstore.TwoPhaseVolatileStore in project narayana by jbosstm.
the class OptimisticUnitTest method init.
private static synchronized void init() throws Exception {
if (!_init) {
StoreManager sm = new StoreManager(null, new TwoPhaseVolatileStore(new ObjectStoreEnvironmentBean()), null);
_init = true;
}
}
Aggregations