Subversion Repositories XServices

Compare Revisions

Regard whitespace Rev 183 → Rev 184

/xservices/trunk/src/java/net/brutex/xservices/util/cache/FindingsCacheServlet.java
23,6 → 23,7
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.ServletContext;
55,11 → 56,12
.getLogger(FindingsCacheServlet.class);
private final List<File> configfiles = new ArrayList<File>();
private final ObjectFactory FACTORY = new ObjectFactory();
private ExecutorService executor;
 
@Override
public void init() throws ServletException {
super.init();
ExecutorService executor = (ExecutorService) getServletContext()
executor = (ExecutorService) getServletContext()
.getAttribute("CACHE_EXECUTOR");
if(! this.initConfigList()) return;
116,6 → 118,7
executor.submit(new ThisRunnable(cbean));
}
logger.info("FindingsCacheServlet has been initialized.");
 
343,4 → 346,24
}
 
}
 
 
 
 
/* (non-Javadoc)
* @see javax.servlet.GenericServlet#destroy()
*/
@Override
public void destroy() {
// TODO Auto-generated method stub
executor.shutdown();
try {
executor.awaitTermination(3, TimeUnit.SECONDS);
logger.info("Cache Worker Threads have shut down.");
} catch (InterruptedException e) {
logger.error("Cache Worker Threads did not terminate within timeout.", e);
}
super.destroy();
}
}