Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.yammer.metrics.reporting;
 
 
A servlet context listener which shuts down the various thread pools when the context is destroyed.
    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        final ServletContext context = sce.getServletContext();
        final Object metricsRegistry = context.getAttribute(.);
        if (metricsRegistry instanceof MetricsRegistry) {
            ((MetricsRegistrymetricsRegistry).shutdown();
        } else {
            Metrics.shutdown();
        }
    }
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        // nothing needs to happen
    }
New to GrepCode? Check out our FAQ X