mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.0 to HEAD
12140: Merged V2.2 to V3.0 11732: Fixed ETWOTWO-804: Node and Transaction Cleanup Job 11747: Missed config for Node and Txn purging 11826: WCM - fix ETWOTWO-817 11951: Fixed ETWOTWO-901: NodeService cleanup must be pluggable 11961: Merged V2.1 to V2.2 11561: ETWOONE-224: when renaming duplicates during copy association names where not renamed 11583: (ALREADY PRESENT) Updated NTLM config example in web.xml - adding missing servlet mappings 11584: Fix for ETWOONE-209 - JavaScript People.createGroup() API now correctly checks for actual group name when testing for existence 11585: Fix for ETWOONE-214 - View In CIFS link now works even when users des not have view permissions on the parent folder 11612: Fix for ETWOONE-91: the description textarea in the modify space properties web form eats one leading newline each time it is submitted 11613: Fix 2.1 build and adjust implementation of ETWOONE-224 fix 11621: Fix for ETWOONE-343 11669: Improved debug from index tracking when exceptions occur 12141: Avoid annoying Spring WARN messages for ClientAbortException 12143: File that should have been deleted in CHK-5460 (rev 12140) 12177: Fix failing FS Deployment Tests since introduction of transaction check advice. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12507 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -30,7 +30,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.node.NodeServicePolicies.BeforeAddAspectPolicy;
|
||||
@@ -59,8 +58,6 @@ import org.alfresco.repo.policy.AssociationPolicyDelegate;
|
||||
import org.alfresco.repo.policy.ClassPolicyDelegate;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.search.Indexer;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
@@ -648,47 +645,4 @@ public abstract class AbstractNodeServiceImpl implements NodeService
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override to implement cleanup processes. The default does nothing.
|
||||
* <p>
|
||||
* This method will be called as the <b>system</b> user but without any
|
||||
* additional transactions.
|
||||
*/
|
||||
protected List<String> cleanupImpl()
|
||||
{
|
||||
// No operation
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/** Prevent multiple executions of the implementation method */
|
||||
private ReentrantLock cleanupLock = new ReentrantLock();
|
||||
public final List<String> cleanup()
|
||||
{
|
||||
boolean locked = cleanupLock.tryLock();
|
||||
if (locked)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Authenticate as system
|
||||
RunAsWork<List<String>> cleanupWork = new RunAsWork<List<String>>()
|
||||
{
|
||||
public List<String> doWork() throws Exception
|
||||
{
|
||||
// The current thread got the lock
|
||||
return cleanupImpl();
|
||||
}
|
||||
};
|
||||
return AuthenticationUtil.runAs(cleanupWork, AuthenticationUtil.SYSTEM_USER_NAME);
|
||||
}
|
||||
finally
|
||||
{
|
||||
cleanupLock.unlock();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user