Code example for ScheduledThreadPoolExecutor

0
            pauseNS=TimeUnit.MILLISECONDS.toNanos(Integer.parseInt(tmp));
        tmp = getInitParameter("pool");
        int pool=tmp==null?Runtime.getRuntime().availableProcessors():Integer.parseInt(tmp);
         
        // Create and start a shared scheduler.   
        scheduler=new ScheduledThreadPoolExecutor(pool);
    } 
 
    @Override 
    public void destroy() 
    { 
        scheduler.shutdown();
    } 
     
    @Override 
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    { 
        // Get the path of the static resource to serve. 
        String info=request.getPathInfo();