2016-11-25 15:42:29 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.smartgears.handlers.container.lifecycle;
|
|
|
|
|
|
|
|
import static org.gcube.smartgears.Constants.accounting_management;
|
|
|
|
|
|
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
|
|
|
|
import org.gcube.accounting.persistence.AccountingPersistenceFactory;
|
|
|
|
import org.gcube.smartgears.handlers.container.ContainerHandler;
|
|
|
|
import org.gcube.smartgears.handlers.container.ContainerLifecycleEvent;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
/**
|
2021-02-22 09:49:18 +01:00
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
2016-11-25 15:42:29 +01:00
|
|
|
*/
|
|
|
|
@XmlRootElement(name = accounting_management)
|
|
|
|
public class AccountingManager extends ContainerHandler {
|
|
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(AccountingManager.class);
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onStop(ContainerLifecycleEvent.Stop e) {
|
|
|
|
logger.trace("Going to flush accounting data");
|
2018-12-10 18:36:19 +01:00
|
|
|
AccountingPersistenceFactory.shutDown();
|
2016-11-25 15:42:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return accounting_management;
|
|
|
|
}
|
|
|
|
}
|