mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
69946: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud) 69860: MNT-11371: Alfresco unable to bootstrap due to LockTryExceptions following an upgrade from 3.4.8 -> 3.4.13 -> 4.0.2 to either 4.1.8 or 4.2.1 Merged 4.1.N to V4.2.N (4.2.3) 69848: MNT-11371: Alfresco unable to bootstrap due to LockTryExceptions following an upgrade from 3.4.8 -> 3.4.13 -> 4.0.2 to either 4.1.8 or 4.2.1 Ability to configure try lock timeout for several different contexts has been implemented. New configuration for every context has been added: - system.lockTryTimeout=100 - system.lockTryTimeout.DictionaryDAOImpl=2000 - system.lockTryTimeout.MessageServiceImpl=${system.lockTryTimeout} - system.lockTryTimeout.PolicyComponentImpl=${system.lockTryTimeout} 'LockHelper.tryLock()' has been modified to accept additional string 'useCase' parameter. Parameter is used for throwing exceptions with contextual messages when lock is not acquired 69858: MNT-11371: Alfresco unable to bootstrap due to LockTryExceptions following an upgrade from 3.4.8 -> 3.4.13 -> 4.0.2 to either 4.1.8 or 4.2.1 Additional boolean parameter 'haveWriteLock' has been added to 'MessageServiceImpl.getResourceBundleBaseNames()' method. It serves to avoid unlocking external write locks. The method still assumes that read lock is acquired if 'haveWriteLock=false'. Read lock will be upgraded to write lock only if 'haveWriteLock' parameter is equal to false git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@70462 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -53,7 +53,15 @@ import org.alfresco.util.LockHelper;
|
||||
// Behaviour Filter
|
||||
private BehaviourFilter filter = null;
|
||||
|
||||
|
||||
// Try lock timeout (MNT-11371)
|
||||
private long tryLockTimeout;
|
||||
|
||||
|
||||
public void setTryLockTimeout(long tryLockTimeout)
|
||||
{
|
||||
this.tryLockTimeout = tryLockTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*/
|
||||
@@ -92,7 +100,7 @@ import org.alfresco.util.LockHelper;
|
||||
@Override
|
||||
public Collection<BehaviourDefinition> getAll()
|
||||
{
|
||||
LockHelper.tryLock(lock.readLock(), 100);
|
||||
LockHelper.tryLock(lock.readLock(), tryLockTimeout, "getting all behavior definitions in 'ClassBehaviourIndex.getAll()'");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -112,7 +120,7 @@ import org.alfresco.util.LockHelper;
|
||||
@SuppressWarnings("unchecked")
|
||||
public Collection<BehaviourDefinition> find(B binding)
|
||||
{
|
||||
LockHelper.tryLock(lock.readLock(), 100);
|
||||
LockHelper.tryLock(lock.readLock(), tryLockTimeout, "searching behavior definitions list in 'ClassBehaviourIndex.find()'");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -175,7 +183,7 @@ import org.alfresco.util.LockHelper;
|
||||
*/
|
||||
public void putClassBehaviour(BehaviourDefinition<B> behaviour)
|
||||
{
|
||||
LockHelper.tryLock(lock.writeLock(), 100);
|
||||
LockHelper.tryLock(lock.writeLock(), tryLockTimeout, "putting behavior definition in 'ClassBehaviourIndex.putClassBehavior()'");
|
||||
try
|
||||
{
|
||||
classMap.put(behaviour);
|
||||
@@ -194,7 +202,7 @@ import org.alfresco.util.LockHelper;
|
||||
*/
|
||||
public void putServiceBehaviour(BehaviourDefinition<ServiceBehaviourBinding> behaviour)
|
||||
{
|
||||
LockHelper.tryLock(lock.writeLock(), 100);
|
||||
LockHelper.tryLock(lock.writeLock(), tryLockTimeout, "putting behavior definition in 'ClassBehaviourIndex.putServiceBehavior()'");
|
||||
try
|
||||
{
|
||||
serviceMap.put(behaviour);
|
||||
@@ -212,7 +220,7 @@ import org.alfresco.util.LockHelper;
|
||||
*/
|
||||
public void removeClassBehaviour(BehaviourDefinition<B> behaviour)
|
||||
{
|
||||
LockHelper.tryLock(lock.writeLock(), 100);
|
||||
LockHelper.tryLock(lock.writeLock(), tryLockTimeout, "removing behavior definition in 'ClassBehaviourIndex.removeClassBehavior()'");
|
||||
try
|
||||
{
|
||||
classMap.remove(behaviour);
|
||||
|
Reference in New Issue
Block a user