Author: areshetnyak
Date: 2011-04-12 09:53:48 -0400 (Tue, 12 Apr 2011)
New Revision: 4228
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionRegistry.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockRemoverHolder.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SystemSearchManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DynamicPooledExecutor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexMerger.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/proccess/WorkerService.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleanerHolder.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/AbstractBackupJob.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobWorkspaceRestore.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/initializer/RemoteWorkspaceInitializationService.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/recovery/ConnectionFailDetector.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/recovery/WaitConfirmation.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/FtpServerImpl.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/data/FtpDataTransiverImpl.java
Log:
EXOJCR-1241 : The patch was applied for "Give a more understandable name to all the
existing Threads"
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionRegistry.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionRegistry.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionRegistry.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -212,7 +212,7 @@
{
super(workTime);
this.sessionTimeOut = sessionTimeOut;
- setName("SessionCleaner " + (id == null ? getId() : id));
+ setName("Session Cleaner " + (id == null ? getId() : id));
setPriority(Thread.MIN_PRIORITY);
setDaemon(true);
start();
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockRemoverHolder.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockRemoverHolder.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockRemoverHolder.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.core.lock;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.impl.proccess.WorkerService;
@@ -39,21 +40,30 @@
*/
private final WorkerService workerService;
+
/**
* Constructor.
* @param entry - RepositoryEntry that may contain lock-remover-max-threads
parameter.
*/
public LockRemoverHolder(RepositoryEntry entry)
{
+ this(null, entry);
+ }
+
+ /**
+ * Constructor.
+ * @param ctx - The {@link ExoContainerContext} in which the {@link
LockRemoverHolder}
+ * is registered
+ * @param entry - RepositoryEntry that may contain lock-remover-max-threads
parameter.
+ */
+ public LockRemoverHolder(ExoContainerContext ctx, RepositoryEntry entry)
+ {
int threadCount = DEFAULT_THREAD_COUNT;
- if (entry != null)
+ if (entry != null && entry.getLockRemoverThreadsCount() > 0)
{
- if (entry.getLockRemoverThreadsCount() > 0)
- {
- threadCount = entry.getLockRemoverThreadsCount();
- }
+ threadCount = entry.getLockRemoverThreadsCount();
}
- workerService = new WorkerService(threadCount, "lock-remover-" +
entry.getName());
+ workerService = new WorkerService(threadCount, "Lock Remover " + (ctx !=
null ? ctx.getName() : (entry == null ? "" : entry.getName())));
}
/**
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -22,6 +22,7 @@
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.WildcardQuery;
import org.exoplatform.commons.utils.PrivilegedFileHelper;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.services.document.DocumentReaderService;
import org.exoplatform.services.jcr.RepositoryService;
@@ -180,6 +181,11 @@
protected final String wsId;
/**
+ * The unique name of the workspace container
+ */
+ protected final String wsContainerId;
+
+ /**
* Component responsible for executing commands in cluster nodes.
*/
protected final RPCService rpcService;
@@ -214,19 +220,21 @@
*/
private RemoteCommand requestForResponsibleForResuming;
- public SearchManager(WorkspaceEntry wEntry, RepositoryEntry rEntry, RepositoryService
rService,
+ public SearchManager(ExoContainerContext ctx, WorkspaceEntry wEntry, RepositoryEntry
rEntry, RepositoryService rService,
QueryHandlerEntry config, NamespaceRegistryImpl nsReg, NodeTypeDataManager ntReg,
WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder
parentSearchManager,
DocumentReaderService extractor, ConfigurationManager cfm, final
RepositoryIndexSearcherHolder indexSearcherHolder)
throws RepositoryException, RepositoryConfigurationException
{
- this(wEntry, rEntry, rService, config, nsReg, ntReg, itemMgr, parentSearchManager,
extractor, cfm,
+ this(ctx, wEntry, rEntry, rService, config, nsReg, ntReg, itemMgr,
parentSearchManager, extractor, cfm,
indexSearcherHolder, null);
}
/**
* Creates a new <code>SearchManager</code>.
*
+ * @param ctx
+ * The eXo Container context in which the SearchManager is registered
* @param rEntry
* repository configuration
* @param rService
@@ -253,13 +261,14 @@
* if the search manager cannot be initialized
* @throws RepositoryConfigurationException
*/
- public SearchManager(WorkspaceEntry wEntry, RepositoryEntry rEntry, RepositoryService
rService,
+ public SearchManager(ExoContainerContext ctx, WorkspaceEntry wEntry, RepositoryEntry
rEntry, RepositoryService rService,
QueryHandlerEntry config, NamespaceRegistryImpl nsReg, NodeTypeDataManager ntReg,
WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder
parentSearchManager,
DocumentReaderService extractor, ConfigurationManager cfm,
final RepositoryIndexSearcherHolder indexSearcherHolder, RPCService rpcService)
throws RepositoryException,
RepositoryConfigurationException
{
+ this.wsContainerId = ctx.getName();
this.rpcService = rpcService;
this.repositoryName = rEntry.getName();
this.workspaceName = wEntry.getName();
@@ -863,8 +872,18 @@
try
{
Class qHandlerClass = Class.forName(className, true,
this.getClass().getClassLoader());
- Constructor constuctor = qHandlerClass.getConstructor(QueryHandlerEntry.class,
ConfigurationManager.class);
- handler = (QueryHandler)constuctor.newInstance(config, cfm);
+ try
+ {
+ // We first try a constructor with the workspace id
+ Constructor constuctor = qHandlerClass.getConstructor(String.class,
QueryHandlerEntry.class, ConfigurationManager.class);
+ handler = (QueryHandler)constuctor.newInstance(wsContainerId, config, cfm);
+ }
+ catch (NoSuchMethodException e)
+ {
+ // No constructor with the workspace id can be found so we use the default
constructor
+ Constructor constuctor =
qHandlerClass.getConstructor(QueryHandlerEntry.class, ConfigurationManager.class);
+ handler = (QueryHandler)constuctor.newInstance(config, cfm);
+ }
QueryHandler parentHandler = (this.parentSearchManager != null) ?
parentSearchManager.getHandler() : null;
QueryHandlerContext context = createQueryHandlerContext(parentHandler);
handler.setContext(context);
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SystemSearchManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SystemSearchManager.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SystemSearchManager.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -16,6 +16,7 @@
*/
package org.exoplatform.services.jcr.impl.core.query;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.services.document.DocumentReaderService;
import org.exoplatform.services.jcr.RepositoryService;
@@ -61,22 +62,22 @@
public static final String INDEX_DIR_SUFFIX = "system";
- public SystemSearchManager(WorkspaceEntry wEntry, RepositoryEntry rEntry,
RepositoryService rService,
+ public SystemSearchManager(ExoContainerContext ctx, WorkspaceEntry wEntry,
RepositoryEntry rEntry, RepositoryService rService,
QueryHandlerEntry config, NamespaceRegistryImpl nsReg, NodeTypeDataManager ntReg,
WorkspacePersistentDataManager itemMgr, DocumentReaderService service,
ConfigurationManager cfm,
RepositoryIndexSearcherHolder indexSearcherHolder, RPCService rpcService) throws
RepositoryException,
RepositoryConfigurationException
{
- super(wEntry, rEntry, rService, config, nsReg, ntReg, itemMgr, null, service, cfm,
indexSearcherHolder,
+ super(ctx, wEntry, rEntry, rService, config, nsReg, ntReg, itemMgr, null, service,
cfm, indexSearcherHolder,
rpcService);
}
- public SystemSearchManager(WorkspaceEntry wEntry, RepositoryEntry rEntry,
RepositoryService rService,
+ public SystemSearchManager(ExoContainerContext ctx, WorkspaceEntry wEntry,
RepositoryEntry rEntry, RepositoryService rService,
QueryHandlerEntry config, NamespaceRegistryImpl nsReg, NodeTypeDataManager ntReg,
WorkspacePersistentDataManager itemMgr, DocumentReaderService service,
ConfigurationManager cfm,
RepositoryIndexSearcherHolder indexSearcherHolder) throws RepositoryException,
RepositoryConfigurationException
{
- this(wEntry, rEntry, rService, config, nsReg, ntReg, itemMgr, service, cfm,
indexSearcherHolder, null);
+ this(ctx, wEntry, rEntry, rService, config, nsReg, ntReg, itemMgr, service, cfm,
indexSearcherHolder, null);
}
@Override
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DynamicPooledExecutor.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DynamicPooledExecutor.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DynamicPooledExecutor.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -16,12 +16,14 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene;
-import java.lang.reflect.InvocationTargetException;
-
import EDU.oswego.cs.dl.util.concurrent.Callable;
import EDU.oswego.cs.dl.util.concurrent.FutureResult;
import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
+import EDU.oswego.cs.dl.util.concurrent.ThreadFactory;
+import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.atomic.AtomicInteger;
+
/**
* <code>DynamicPooledExecutor</code> implements an executor, which
dynamically
* adjusts its maximum number of threads according to the number of available
@@ -50,6 +52,12 @@
public DynamicPooledExecutor() {
executor = new PooledExecutor();
executor.setKeepAliveTime(500);
+ executor.setThreadFactory(new ThreadFactory() {
+ AtomicInteger count = new AtomicInteger();
+ public Thread newThread(Runnable command) {
+ return new Thread(command, "DynamicPooledExecutor-thread-" +
count.incrementAndGet());
+ }
+ });
adjustPoolSize();
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexMerger.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexMerger.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexMerger.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -108,7 +108,7 @@
IndexMerger(MultiIndex multiIndex)
{
this.multiIndex = multiIndex;
- setName("IndexMerger");
+ setName("Index Merger" + (multiIndex.workspaceId == null ? "" :
" " + multiIndex.workspaceId));
setDaemon(true);
try
{
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -197,7 +197,7 @@
/**
* Timer to schedule flushes of this index after some idle time.
*/
- private static final Timer FLUSH_TIMER = new Timer(true);
+ private static final Timer FLUSH_TIMER = new Timer("MultiIndex Flush Timer",
true);
/**
* Task that is periodically called by {@link #FLUSH_TIMER} and checks if
@@ -253,6 +253,11 @@
private final IndexerIoModeHandler modeHandler;
/**
+ * The unique id of the workspace corresponding to this multi index
+ */
+ final String workspaceId;
+
+ /**
* Creates a new MultiIndex.
*
* @param handler
@@ -272,6 +277,7 @@
// this method is run in privileged mode internally
this.indexDir = directoryManager.getDirectory(".");
this.handler = handler;
+ this.workspaceId = handler.getWsId();
this.cache = new DocNumberCache(handler.getCacheSize());
this.indexingTree = indexingTree;
this.nsMappings = handler.getNamespaceMappings();
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -482,6 +482,11 @@
*/
private ErrorLog errorLog;
+ /**
+ * The unique id of the workspace corresponding to current instance of {@link
SearchIndex}
+ */
+ private final String wsId;
+
private final ConfigurationManager cfm;
/**
@@ -515,25 +520,36 @@
* @throws RepositoryConfigurationException
* @throws IOException
*/
- public SearchIndex(QueryHandlerEntry queryHandlerConfig, ConfigurationManager cfm)
throws IOException,
+ public SearchIndex(String wsId, QueryHandlerEntry queryHandlerConfig,
ConfigurationManager cfm) throws IOException,
RepositoryConfigurationException
{
+ this.wsId = wsId;
this.analyzer = new JcrStandartAnalyzer();
- // this.queryHandlerConfig = new QueryHandlerEntryWrapper(
- // queryHandlerConfig);
this.cfm = cfm;
SearchIndexConfigurationHelper searchIndexConfigurationHelper = new
SearchIndexConfigurationHelper(this);
searchIndexConfigurationHelper.init(queryHandlerConfig);
}
/**
+ * Working constructor.
+ *
+ * @throws RepositoryConfigurationException
+ * @throws IOException
+ */
+ public SearchIndex(QueryHandlerEntry queryHandlerConfig, ConfigurationManager cfm)
throws IOException,
+ RepositoryConfigurationException
+ {
+ this(null, queryHandlerConfig, cfm);
+ }
+
+ /**
* For test constructor.
*/
public SearchIndex()
{
this.analyzer = new JcrStandartAnalyzer();
- // this.queryHandlerConfig = null;
this.cfm = null;
+ this.wsId = null;
}
/**
@@ -700,6 +716,14 @@
}
modeHandler.addIndexerIoModeListener(this);
+ }
+
+ /**
+ * @return the wsId
+ */
+ public String getWsId()
+ {
+ return wsId;
}
private void reindex(boolean doReindexing, boolean doCheck, ItemDataConsumer
itemStateManager) throws IOException
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -45,10 +45,10 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.Timer;
import java.util.TimerTask;
import java.util.WeakHashMap;
+import java.util.Map.Entry;
import java.util.concurrent.Semaphore;
import java.util.concurrent.locks.ReentrantLock;
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/proccess/WorkerService.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/proccess/WorkerService.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/proccess/WorkerService.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -59,7 +59,7 @@
this.isDaemon = isDaemon;
SecurityManager s = System.getSecurityManager();
group = (s != null) ? s.getThreadGroup() :
Thread.currentThread().getThreadGroup();
- this.namePrefix = namePrefix + "-" + poolNumber.getAndIncrement() +
"-thread-";
+ this.namePrefix = (namePrefix == null || namePrefix.isEmpty()) ?
"pool-" + poolNumber.getAndIncrement() + "-thread-" : namePrefix +
" ";
}
public Thread newThread(Runnable r)
@@ -79,7 +79,7 @@
*/
public WorkerService(int threadCount)
{
- this(threadCount, "pool");
+ this(threadCount, null);
}
/**
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -19,6 +19,7 @@
package org.exoplatform.services.jcr.impl.util.io;
import org.exoplatform.commons.utils.PrivilegedFileHelper;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.services.jcr.impl.proccess.WorkerThread;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -50,11 +51,21 @@
this(DEFAULT_TIMEOUT);
}
+ public FileCleaner(ExoContainerContext ctx)
+ {
+ this(null, ctx, DEFAULT_TIMEOUT);
+ }
+
public FileCleaner(long timeout)
{
this(timeout, true);
}
+ public FileCleaner(String prefix, ExoContainerContext ctx, long timeout)
+ {
+ this(ctx == null ? prefix : (prefix == null ? "" : prefix + "
") + ctx.getName(), timeout, true);
+ }
+
public FileCleaner(boolean start)
{
this(DEFAULT_TIMEOUT, start);
@@ -62,8 +73,13 @@
public FileCleaner(long timeout, boolean start)
{
+ this(null, timeout, start);
+ }
+
+ public FileCleaner(String id, long timeout, boolean start)
+ {
super(timeout);
- setName("FileCleaner " + getId());
+ setName("File Cleaner " + (id == null ? getId() : id));
setDaemon(true);
setPriority(Thread.MIN_PRIORITY);
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleanerHolder.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleanerHolder.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleanerHolder.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.services.jcr.impl.util.io;
+import org.exoplatform.container.ExoContainerContext;
+
/**
* Created by The eXo Platform SAS. <br/> per workspace container file cleaner
holder object
*
@@ -31,9 +33,14 @@
public FileCleanerHolder()
{
- this.fileCleaner = new FileCleaner();
+ this(null);
}
+ public FileCleanerHolder(ExoContainerContext ctx)
+ {
+ this.fileCleaner = new FileCleaner(ctx);
+ }
+
public FileCleaner getFileCleaner()
{
return fileCleaner;
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/AbstractBackupJob.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/AbstractBackupJob.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/AbstractBackupJob.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -66,6 +66,7 @@
NotifyThread(BackupJobListener[] listeners, BackupJob job)
{
+ super("NotifyThread");
super.setDaemon(true); // The Java Virtual Machine exits when the only threads
running are all
// daemon threads.
this.listeners = listeners;
@@ -92,6 +93,7 @@
ErrorNotifyThread(BackupJobListener[] listeners, BackupJob job, String message,
Throwable error)
{
super(listeners, job);
+ setName("ErrorNotifyThread");
this.error = error;
this.message = message;
}
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupChainImpl.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -311,7 +311,7 @@
}
else
{
- Thread starter = new Thread()
+ Thread starter = new Thread("IncrementalBackup Starter")
{
@Override
public void run()
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -22,6 +22,7 @@
import org.exoplatform.commons.utils.PrivilegedFileHelper;
import org.exoplatform.commons.utils.PrivilegedSystemHelper;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.PropertiesParam;
import org.exoplatform.services.jcr.RepositoryService;
@@ -208,7 +209,7 @@
private final WorkspaceBackupAutoStopper workspaceBackupStopper;
private final RepositoryBackupAutoStopper repositoryBackupStopper;
-
+
/**
* Temporary directory;
*/
@@ -309,6 +310,11 @@
class WorkspaceBackupAutoStopper extends Thread
{
+ WorkspaceBackupAutoStopper(ExoContainerContext ctx)
+ {
+ super("WorkspaceBackupAutoStopper" + (ctx == null ? "" :
" " + ctx.getName()));
+ }
+
/**
* {@inheritDoc}
*/
@@ -359,6 +365,11 @@
class RepositoryBackupAutoStopper extends Thread
{
+ RepositoryBackupAutoStopper(ExoContainerContext ctx)
+ {
+ super("RepositoryBackupAutoStopper" + (ctx == null ? "" :
" " + ctx.getName()));
+ }
+
/**
* {@inheritDoc}
*/
@@ -410,21 +421,47 @@
*/
public BackupManagerImpl(InitParams initParams, RepositoryService repoService)
{
- this(initParams, repoService, null);
+ this(null, initParams, repoService, null);
}
/**
* BackupManagerImpl constructor.
*
+ * @param initParams
* InitParams, the init parameters
* @param repoService
* RepositoryService, the repository service
+ */
+ public BackupManagerImpl(ExoContainerContext ctx, InitParams initParams,
RepositoryService repoService)
+ {
+ this(ctx, initParams, repoService, null);
+ }
+
+ /**
+ * BackupManagerImpl constructor.
+ *
+ * InitParams, the init parameters
+ * @param repoService
+ * RepositoryService, the repository service
* @param registryService
* RegistryService, the registry service
*/
public BackupManagerImpl(InitParams initParams, RepositoryService repoService,
RegistryService registryService)
{
-
+ this(null, initParams, repoService, registryService);
+ }
+
+ /**
+ * BackupManagerImpl constructor.
+ *
+ * InitParams, the init parameters
+ * @param repoService
+ * RepositoryService, the repository service
+ * @param registryService
+ * RegistryService, the registry service
+ */
+ public BackupManagerImpl(ExoContainerContext ctx, InitParams initParams,
RepositoryService repoService, RegistryService registryService)
+ {
this.messagesListener = new MessagesListener();
this.repoService = repoService;
this.registryService = registryService;
@@ -457,13 +494,13 @@
this.restoreJobs = new ArrayList<JobWorkspaceRestore>();
this.restoreRepositoryJobs = new ArrayList<JobRepositoryRestore>();
- this.workspaceBackupStopper = new WorkspaceBackupAutoStopper();
+ this.workspaceBackupStopper = new WorkspaceBackupAutoStopper(ctx);
this.workspaceBackupStopper.start();
- this.repositoryBackupStopper = new RepositoryBackupAutoStopper();
+ this.repositoryBackupStopper = new RepositoryBackupAutoStopper(ctx);
this.repositoryBackupStopper.start();
}
-
+
/**
* {@inheritDoc}
*/
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobRepositoryRestore.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -117,6 +117,7 @@
RepositoryEntry repositoryEntry, Map<String, BackupChainLog>
workspacesMapping,
RepositoryBackupChainLog backupChainLog)
{
+ super("JobRepositoryRestore " + repositoryEntry.getName());
this.repositoryService = repoService;
this.backupManager = backupManagerImpl;
this.repositoryEntry = repositoryEntry;
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobWorkspaceRestore.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobWorkspaceRestore.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobWorkspaceRestore.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -134,6 +134,7 @@
public JobWorkspaceRestore(RepositoryService repositoryService, BackupManager
backupManager, String repositoryName,
BackupChainLog log, WorkspaceEntry wEntry)
{
+ super("JobWorkspaceRestore " + wEntry.getUniqueName());
this.repositoryService = repositoryService;
this.backupManager = backupManager;
this.repositoryName = repositoryName;
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/initializer/RemoteWorkspaceInitializationService.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/initializer/RemoteWorkspaceInitializationService.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/initializer/RemoteWorkspaceInitializationService.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -392,6 +392,7 @@
*/
public WorkspaceDataPublisher(BackupChain chain, RemoteTransport transport)
{
+ super("WorkspaceDataPublisher");
this.backupChain = chain;
this.transport = transport;
}
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/recovery/ConnectionFailDetector.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/recovery/ConnectionFailDetector.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/recovery/ConnectionFailDetector.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -310,6 +310,11 @@
*/
private final ConcurrentLinkedQueue<Integer> queue = new
ConcurrentLinkedQueue<Integer>();
+ public ViewChecker()
+ {
+ super("ViewChecker");
+ }
+
/**
* putView.
*
@@ -368,6 +373,7 @@
*/
public ReconectTtread(boolean isStop)
{
+ super("ReconectTtread");
log.info("Thread '" + getName() + "' is init ...");
this.isStop = isStop;
}
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/recovery/WaitConfirmation.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/recovery/WaitConfirmation.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/recovery/WaitConfirmation.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -68,7 +68,7 @@
*/
WaitConfirmation(long timeOut, RecoveryManager recoveryManager, String identifier)
{
- super();
+ super("WaitConfirmation " + identifier);
this.timeOut = timeOut;
this.recoveryManager = recoveryManager;
this.identifier = identifier;
Modified:
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/FtpServerImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/FtpServerImpl.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/FtpServerImpl.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -219,6 +219,7 @@
{
this.ftpServer = ftpServer;
this.serverSocket = serverSocket;
+ setName("Ftp Server" + (configuration.getPortalContainer() == null ?
"" : " " + configuration.getPortalContainer().getName()));
setDaemon(true);
}
Modified:
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/data/FtpDataTransiverImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/data/FtpDataTransiverImpl.java 2011-04-11
17:42:26 UTC (rev 4227)
+++
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/data/FtpDataTransiverImpl.java 2011-04-12
13:53:48 UTC (rev 4228)
@@ -209,6 +209,11 @@
protected class AcceptDataConnect extends Thread
{
+ public AcceptDataConnect()
+ {
+ super("AcceptDataConnect" + (configuration.getPortalContainer() ==
null ? "" : " " + configuration.getPortalContainer().getName()));
+ }
+
protected Log acceptLog = ExoLogger.getLogger("jcr.AcceptDataConnect");
@Override
@@ -237,6 +242,11 @@
protected class ConnectDataPort extends Thread
{
+ public ConnectDataPort()
+ {
+ super("ConnectDataPort" + (configuration.getPortalContainer() == null
? "" : " " + configuration.getPortalContainer().getName()));
+ }
+
protected Log connectLog = ExoLogger.getLogger("jcr.ConnectDataPort");
@Override