mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added a leetle bit of logging in a few places.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3328 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -141,7 +141,6 @@ public abstract class AVMNodeImpl implements AVMNode, Serializable
|
||||
}
|
||||
if (!(obj instanceof AVMNode))
|
||||
{
|
||||
System.err.println("Failing AVMNodeImpl.equals");
|
||||
return false;
|
||||
}
|
||||
return fID == ((AVMNode)obj).getId();
|
||||
|
@@ -28,6 +28,7 @@ import java.util.List;
|
||||
import java.util.SortedMap;
|
||||
|
||||
import org.alfresco.repo.avm.SuperRepository;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Implements the AVMService. Stub.
|
||||
@@ -35,6 +36,8 @@ import org.alfresco.repo.avm.SuperRepository;
|
||||
*/
|
||||
public class AVMServiceImpl implements AVMService
|
||||
{
|
||||
private static Logger fgLogger = Logger.getLogger(AVMServiceImpl.class);
|
||||
|
||||
/**
|
||||
* The RetryingTransaction.
|
||||
*/
|
||||
@@ -103,15 +106,19 @@ public class AVMServiceImpl implements AVMService
|
||||
fContentIssuer,
|
||||
fLayerIssuer,
|
||||
fStorage);
|
||||
fgLogger.info("Initialized AVMService and SuperRepository");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace(System.err);
|
||||
// TODO Log this and abort in some useful way.
|
||||
fgLogger.fatal("Failed to initialize AVMService", e);
|
||||
// TODO Abort in some useful way.
|
||||
}
|
||||
if (fInitialize)
|
||||
{
|
||||
File storageDir = new File(fStorage);
|
||||
storageDir.mkdirs();
|
||||
createRepository("main");
|
||||
fgLogger.info("Created new main repository");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -19,6 +19,9 @@ package org.alfresco.repo.avm;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* This is the background thread for reaping no longer referenced nodes
|
||||
* in the AVM repository. These orphans arise from purge operations.
|
||||
@@ -26,6 +29,7 @@ import java.util.List;
|
||||
*/
|
||||
public class OrphanReaper implements Runnable
|
||||
{
|
||||
private Log fgLogger = LogFactory.getLog(OrphanReaper.class);
|
||||
/**
|
||||
* The HibernateTxn instance.
|
||||
*/
|
||||
@@ -274,8 +278,7 @@ public class OrphanReaper implements Runnable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace(System.err);
|
||||
// TODO Log this properly.
|
||||
fgLogger.error("Garbage collector error", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,6 @@ import org.alfresco.repo.avm.AVMNodeUnwrapper;
|
||||
import org.alfresco.repo.avm.DirectoryNode;
|
||||
import org.alfresco.repo.avm.Repository;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.Session;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
|
||||
/**
|
||||
|
@@ -23,6 +23,7 @@ import org.alfresco.repo.avm.AVMException;
|
||||
import org.alfresco.repo.avm.AVMNotFoundException;
|
||||
import org.alfresco.repo.avm.RetryingTransactionCallback;
|
||||
import org.alfresco.repo.avm.RetryingTransaction;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.dao.DataRetrievalFailureException;
|
||||
import org.springframework.dao.DeadlockLoserDataAccessException;
|
||||
import org.springframework.dao.OptimisticLockingFailureException;
|
||||
@@ -38,6 +39,7 @@ import org.springframework.transaction.TransactionStatus;
|
||||
*/
|
||||
public class HibernateTxn extends HibernateTemplate implements RetryingTransaction
|
||||
{
|
||||
private static Logger fgLogger = Logger.getLogger(HibernateTxn.class);
|
||||
/**
|
||||
* The transaction manager.
|
||||
*/
|
||||
@@ -99,7 +101,7 @@ public class HibernateTxn extends HibernateTemplate implements RetryingTransacti
|
||||
// If we've lost a race or we've deadlocked, retry.
|
||||
if (t instanceof DeadlockLoserDataAccessException)
|
||||
{
|
||||
System.err.println("Deadlock.");
|
||||
fgLogger.info("Deadlock");
|
||||
try
|
||||
{
|
||||
long interval;
|
||||
@@ -117,7 +119,7 @@ public class HibernateTxn extends HibernateTemplate implements RetryingTransacti
|
||||
}
|
||||
if (t instanceof OptimisticLockingFailureException)
|
||||
{
|
||||
System.err.println("Lost Race.");
|
||||
fgLogger.info("Lost Race");
|
||||
continue;
|
||||
}
|
||||
if (t instanceof AVMException)
|
||||
|
Reference in New Issue
Block a user