mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
13218: Partial fix for ETHREEOH-1259 - the null pointer exceptions are gone to be replaced by sensible error messages. 13220: Merged V3.0 to V3.1 13219: Build Fix for error in hand merge of r13141 from V2.2 to V3.0 13226: Clearer debugging of exceptions during NodeService cleanup 13228: ETHREEOH-1250 13229: Fix for ETHREEOH-1184: Share webscript configuration does not support international chars as values 13235: Add support to exclude admin and guest from person permission fix ups. Tidy up for ETHREEOH-1239 13239: Build Fix 13243: ETHREEOH-1308: Update AMPs to indicate unsupported status 13247: Build fix - do not delete admin :-) 13248: Fix build 13254: Fix for ETHREEOH-1351: Schemas containing an enumeration with an empty string ... ___________________________________________________________________ Modified: svn:mergeinfo Merged /alfresco/BRANCHES/V3.0:r13219 Merged /alfresco/BRANCHES/V3.1:r13218-13220,13224,13226-13229,13231-13232,13234-13237,13239,13241,13243-13248,13250,13252-13254 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13612 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
65 lines
2.1 KiB
Java
65 lines
2.1 KiB
Java
package org.alfresco.repo.node.cleanup;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import org.alfresco.error.StackTraceUtil;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
/**
|
|
* A {@link NodeCleanupWorker worker} that aggregates any number of
|
|
* {@link #register(NodeCleanupWorker) registered} workers.
|
|
*
|
|
* @author Derek Hulley
|
|
* @since 2.2 SP2
|
|
*/
|
|
public class NodeCleanupRegistry implements NodeCleanupWorker
|
|
{
|
|
private static Log logger = LogFactory.getLog(NodeCleanupRegistry.class);
|
|
|
|
private List<NodeCleanupWorker> cleanupWorkers;
|
|
|
|
public NodeCleanupRegistry()
|
|
{
|
|
cleanupWorkers = new ArrayList<NodeCleanupWorker>(5);
|
|
}
|
|
|
|
public void register(NodeCleanupWorker cleanupWorker)
|
|
{
|
|
cleanupWorkers.add(cleanupWorker);
|
|
}
|
|
|
|
/**
|
|
* Calls all registered cleaners in order, without transactions or authentication.
|
|
* The return messages are aggregated.
|
|
*/
|
|
public List<String> doClean()
|
|
{
|
|
List<String> results = new ArrayList<String>(100);
|
|
for (NodeCleanupWorker cleanupWorker : cleanupWorkers)
|
|
{
|
|
try
|
|
{
|
|
results.addAll(cleanupWorker.doClean());
|
|
}
|
|
catch (Throwable e)
|
|
{
|
|
// This failed. The cleaner should be handling this, but we can't guarantee it.
|
|
logger.error(
|
|
"NodeCleanupWork doesn't handle all exception conditions: " +
|
|
cleanupWorker.getClass().getName());
|
|
StringBuilder sb = new StringBuilder(1024);
|
|
StackTraceUtil.buildStackTrace(
|
|
"Node cleanup failed: " +
|
|
" Worker: " + cleanupWorker.getClass().getName() + "\n" +
|
|
" Error: " + e.getMessage(),
|
|
e.getStackTrace(),
|
|
sb,
|
|
0);
|
|
results.add(sb.toString());
|
|
}
|
|
}
|
|
return results;
|
|
}
|
|
} |