@Override
 public MetricsService getService() {
   if (metricsService != null && metricsService.isEnabled()) {
     return metricsService;
   }
   return null;
 }
  @Override
  public void contextDestroyed(ServletContextEvent sce) {

    metricsService.destroy();
    configurationService.unsubscribeFrom("metrics.cfg.xml", metricsCfgListener);
  }