Refs #11232: Add Regex Rules to Accounting Service

Task-Url: https://support.d4science.org/issues/11232

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-service@164464 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2018-02-20 17:28:30 +00:00
parent 9a5214828e
commit fec8b096a1
1 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package org.gcube.accounting.service;
import org.gcube.accounting.aggregator.RegexRulesAggregator;
import org.gcube.accounting.analytics.persistence.AccountingPersistenceQueryFactory;
import org.gcube.accounting.persistence.AccountingPersistenceFactory;
import org.gcube.common.authorization.client.Constants;
@ -11,6 +12,9 @@ import org.gcube.smartgears.ApplicationManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public class AccountingServiceInitializer implements ApplicationManager {
private static Logger logger = LoggerFactory.getLogger(AccountingServiceInitializer.class);
@ -44,6 +48,9 @@ public class AccountingServiceInitializer implements ApplicationManager {
AccountingPersistenceFactory.getPersistence();
// Initializing the persistence connector used for query
AccountingPersistenceQueryFactory.getInstance();
// Initializing RegexRulesAggregator
RegexRulesAggregator.getInstance().start();
}
public void onShutdown() {
@ -60,6 +67,8 @@ public class AccountingServiceInitializer implements ApplicationManager {
// Closing the persistence connector used for query
AccountingPersistenceQueryFactory.getInstance().close();
RegexRulesAggregator.getInstance().stop();
logger.trace("\n-------------------------------------------------------\n"
+ "Accounting Service Stopped Successfully on context {}\n"
+ "-------------------------------------------------------", context);