Added log to test on IS

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@120305 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-11-18 16:20:11 +00:00
parent 615dff37df
commit 7f5e0fc426
1 changed files with 6 additions and 1 deletions

View File

@ -69,6 +69,7 @@ public abstract class AccountingPersistenceBackendFactory {
}
protected static FallbackPersistenceBackend createFallback(String scope){
logger.debug("Creating {} for scope {}", FallbackPersistenceBackend.class.getSimpleName(), scope);
File fallbackFile = null;
if(scope!=null){
ScopeBean bean = new ScopeBean(scope);
@ -84,6 +85,8 @@ public abstract class AccountingPersistenceBackendFactory {
}
protected static AccountingPersistenceBackend discoverAccountingPersistenceBackend(String scope){
logger.debug("Discovering {} for scope {}",
AccountingPersistenceBackend.class.getSimpleName(), scope);
ServiceLoader<AccountingPersistenceBackend> serviceLoader = ServiceLoader.load(AccountingPersistenceBackend.class);
for (AccountingPersistenceBackend foundPersistence : serviceLoader) {
try {
@ -111,7 +114,7 @@ public abstract class AccountingPersistenceBackendFactory {
protected static AccountingPersistenceBackend rediscoverAccountingPersistenceBackend(AccountingPersistenceBackend actual, String scope){
Long now = Calendar.getInstance().getTimeInMillis();
Long lastCheckTimestamp = fallbackLastCheck.get(scope);
logger.trace("Last check was {}", lastCheckTimestamp);
logger.debug("Last check for scope {} was {}", scope, lastCheckTimestamp);
if( (lastCheckTimestamp + FALLBACK_RETRY_TIME) <= now ){
logger.debug("The {} for scope {} is {}. Is time to rediscover if there is another possibility.",
@ -178,8 +181,10 @@ public abstract class AccountingPersistenceBackendFactory {
}
AccountingPersistenceBackend persistence = null;
logger.debug("Going to synchronized block in getPersistenceBackend");
synchronized (accountingPersistenceBackends) {
persistence = accountingPersistenceBackends.get(scope);
logger.debug("{} {}", AccountingPersistenceBackend.class.getSimpleName(), persistence);
if(persistence==null){
/*
* Setting FallbackPersistence and unlocking.