private static DsoSerializationStrategy getSingletonDsoSerializationStrategy() { ConcurrentMap<String, Object> root = new ConcurrentDistributedMap<String, Object>(LockType.WRITE, new HashcodeLockStrategy(), 8); ManagerUtil.beginLock(ROOT_NAME_UTILITIES, Manager.LOCK_TYPE_WRITE); try { root = (ConcurrentMap<String, Object>) ManagerUtil.lookupOrCreateRoot(ROOT_NAME_UTILITIES, root); root.putIfAbsent(DsoSerializationStrategy.class.getName(), new DsoSerializationStrategy()); setNotClearable(root); } finally { ManagerUtil.commitLock(ROOT_NAME_UTILITIES, Manager.LOCK_TYPE_WRITE); } return (DsoSerializationStrategy) root.get(DsoSerializationStrategy.class.getName()); }
ManagerUtil.beginLock(rootName, Manager.LOCK_TYPE_WRITE); try { hibernateCaches = (ConcurrentMap<String, Cache>) ManagerUtil.lookupOrCreateRoot(rootName, temp); if (hibernateCaches instanceof Clearable) { ((Clearable) hibernateCaches).setEvictionEnabled(false);
private static ConcurrentMap<String, ConcurrentMap<String, AsyncCoordinator>> getAsyncCoordinatorRoot() { ConcurrentMap<String, ConcurrentMap<String, AsyncCoordinator>> root = new ConcurrentDistributedMap<String, ConcurrentMap<String, AsyncCoordinator>>( LockType.WRITE, new HashcodeLockStrategy(), 8); ManagerUtil.beginLock(ROOT_NAME_EHCACHE_ASYNC_COORDINATOR, Manager.LOCK_TYPE_WRITE); try { root = (ConcurrentMap<String, ConcurrentMap<String, AsyncCoordinator>>) ManagerUtil .lookupOrCreateRoot(ROOT_NAME_EHCACHE_ASYNC_COORDINATOR, root); setNotClearable(root); } finally { ManagerUtil.commitLock(ROOT_NAME_EHCACHE_ASYNC_COORDINATOR, Manager.LOCK_TYPE_WRITE); } return root; }
private static ConcurrentMap<String, ConcurrentMap<String, ClusteredEventReplicator>> getEventReplicatorRoot() { ConcurrentMap<String, ConcurrentMap<String, ClusteredEventReplicator>> root = new ConcurrentDistributedMap<String, ConcurrentMap<String, ClusteredEventReplicator>>( LockType.WRITE, new HashcodeLockStrategy(), 8); ManagerUtil.beginLock(ROOT_NAME_EVENT_REPLICATOR, Manager.LOCK_TYPE_WRITE); try { root = (ConcurrentMap<String, ConcurrentMap<String, ClusteredEventReplicator>>) ManagerUtil .lookupOrCreateRoot(ROOT_NAME_EVENT_REPLICATOR, root); setNotClearable(root); } finally { ManagerUtil.commitLock(ROOT_NAME_EVENT_REPLICATOR, Manager.LOCK_TYPE_WRITE); } return root; }
private static ConcurrentMap<String, ConcurrentMap<String, ClusteredStore>> getStoreRoot() { // XXX: This root name is certainly open for debate // XXX: Caching this root lookup and/or being optimistic and using a read lock is possible, though likely not a // useful optimization String rootName = "ehcache-store"; ConcurrentMap<String, ConcurrentMap<String, ClusteredStore>> root = new ConcurrentDistributedMap<String, ConcurrentMap<String, ClusteredStore>>( LockType.WRITE, new HashcodeLockStrategy(), 8); ManagerUtil.beginLock(rootName, Manager.LOCK_TYPE_WRITE); try { root = (ConcurrentMap<String, ConcurrentMap<String, ClusteredStore>>) ManagerUtil.lookupOrCreateRoot(rootName, root); setNotClearable(root); } finally { ManagerUtil.commitLock(rootName, Manager.LOCK_TYPE_WRITE); } return root; }
private static ConcurrentMap<String, ConcurrentMap<String, ClusteredStore>> getStoreRoot(String rootName) { // XXX: This root name is certainly open for debate // XXX: Caching this root lookup and/or being optimistic and using a read lock is possible, though likely not a // useful optimization ConcurrentMap<String, ConcurrentMap<String, ClusteredStore>> root = new ConcurrentDistributedMap<String, ConcurrentMap<String, ClusteredStore>>( LockType.WRITE, new HashcodeLockStrategy(), 8); ManagerUtil.beginLock(rootName, Manager.LOCK_TYPE_WRITE); try { root = (ConcurrentMap<String, ConcurrentMap<String, ClusteredStore>>) ManagerUtil.lookupOrCreateRoot(rootName, root); setNotClearable(root); } finally { ManagerUtil.commitLock(rootName, Manager.LOCK_TYPE_WRITE); } return root; }
private static ConcurrentMap<String, ConcurrentMap<String, EhcacheXAStore>> getXAStoreRoot() { // XXX: This root name is certainly open for debate // XXX: Caching this root lookup and/or being optimistic and using a read lock is possible, though likely not a // useful optimization String rootName = "ehcache-xastore-store"; ConcurrentMap<String, ConcurrentMap<String, EhcacheXAStore>> root = new ConcurrentDistributedMap<String, ConcurrentMap<String, EhcacheXAStore>>( LockType.WRITE, new HashcodeLockStrategy(), 8); ManagerUtil.beginLock(rootName, Manager.LOCK_TYPE_WRITE); try { root = (ConcurrentMap<String, ConcurrentMap<String, EhcacheXAStore>>) ManagerUtil.lookupOrCreateRoot(rootName, root); setNotClearable(root); } finally { ManagerUtil.commitLock(rootName, Manager.LOCK_TYPE_WRITE); } return root; }
return (T) ManagerUtil.lookupOrCreateRoot(name, createdRoot); } finally { writeLock.unlock();
return (T) ManagerUtil.lookupOrCreateRoot(name, createdRoot); } finally { writeLock.unlock();
return (T) ManagerUtil.lookupOrCreateRoot(name, createdRoot); } finally { writeLock.unlock();