Subversion Repositories XServices

Rev

Rev 102 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 102 Rev 184
Line 21... Line 21...
21
import java.util.ArrayList;
21
import java.util.ArrayList;
22
import java.util.Enumeration;
22
import java.util.Enumeration;
23
import java.util.Iterator;
23
import java.util.Iterator;
24
import java.util.List;
24
import java.util.List;
25
import java.util.concurrent.ExecutorService;
25
import java.util.concurrent.ExecutorService;
-
 
26
import java.util.concurrent.TimeUnit;
26
import java.util.regex.Matcher;
27
import java.util.regex.Matcher;
27
import java.util.regex.Pattern;
28
import java.util.regex.Pattern;
28
import javax.servlet.ServletContext;
29
import javax.servlet.ServletContext;
29
import javax.servlet.ServletException;
30
import javax.servlet.ServletException;
30
import javax.servlet.http.HttpServlet;
31
import javax.servlet.http.HttpServlet;
Line 53... Line 54...
53
	private static final long serialVersionUID = 4041338473949999960L;
54
	private static final long serialVersionUID = 4041338473949999960L;
54
	private final static Logger logger = Logger
55
	private final static Logger logger = Logger
55
			.getLogger(FindingsCacheServlet.class);
56
			.getLogger(FindingsCacheServlet.class);
56
	private final List<File> configfiles = new ArrayList<File>();
57
	private final List<File> configfiles = new ArrayList<File>();
57
	private final ObjectFactory FACTORY = new ObjectFactory();
58
	private final ObjectFactory FACTORY = new ObjectFactory();
-
 
59
	private ExecutorService executor;
Line 58... Line 60...
58
 
60
 
59
	@Override
61
	@Override
60
	public void init() throws ServletException {
62
	public void init() throws ServletException {
61
		super.init();
63
		super.init();
62
		ExecutorService executor = (ExecutorService) getServletContext()
64
		executor = (ExecutorService) getServletContext()
Line 63... Line 65...
63
				.getAttribute("CACHE_EXECUTOR");
65
				.getAttribute("CACHE_EXECUTOR");
64
		
66
		
Line 114... Line 116...
114
			
116
			
-
 
117
 
115
 
118
			
116
			
119
			
Line 117... Line 120...
117
			
120
			executor.submit(new ThisRunnable(cbean));
Line 341... Line 344...
341
			finding.setROOT(item.getROOT());
344
			finding.setROOT(item.getROOT());
342
			return finding;
345
			return finding;
343
		}
346
		}
Line 344... Line 347...
344
 
347
 
-
 
348
	}
-
 
349
 
-
 
350
 
-
 
351
 
-
 
352
 
-
 
353
	/* (non-Javadoc)
-
 
354
	 * @see javax.servlet.GenericServlet#destroy()
-
 
355
	 */
-
 
356
	@Override
-
 
357
	public void destroy() {
-
 
358
		// TODO Auto-generated method stub
-
 
359
		executor.shutdown();
-
 
360
		try {
-
 
361
			executor.awaitTermination(3, TimeUnit.SECONDS);
-
 
362
			logger.info("Cache Worker Threads have shut down.");
-
 
363
		} catch (InterruptedException e) {
-
 
364
			logger.error("Cache Worker Threads did not terminate within timeout.", e);
-
 
365
		}
-
 
366
		super.destroy();
-
 
367
	}
345
	}
368
	
346
}
369
}