@@ -0,0 +1,2337 @@
+/**%0A *  Copyright 2011 Galiel 3.14 Ltd. All rights reserved.%0A *  Use is subject to license terms.%0A *%0A * Created on 28 December 2012%0A */%0Apackage com.htmlspeed.server;%0A%0Aimport java.util.TimerTask;%0Aimport java.util.concurrent.ExecutorService;%0A%0A/**%0A * RefreshTimerTask%0A *%0A * Periodically refreshes state-less pages and loads once%0A * state-full pages (that listed in config-file %22refresh.txt%22).%0A *%0A * @author  Eldad Zamler%0A * @version $Revision: 1.1 $$Date: 2012/12/28 13:35:30 $%0A */%0Apublic class RefreshTimerTask extends TimerTask%0A%7B%0A    /**%0A     * Full url of refreshed page.%0A     */%0A    private String _url;%0A%0A    /**%0A     * Used thread-pool (allocated by ConfigUtils).%0A     */%0A    private ExecutorService _pool;%0A%0A    /**%0A     * The single instance of HtmlSpeedServlet.%0A     * Initialized by HtmlSpeedServlet.init().%0A     */%0A    private static HtmlSpeedServlet _servlet;%0A%0A    /**%0A     * Calls HtmlSpeedServlet.service from a thread taken from the pool.%0A     */%0A    private Refresher _refresher;%0A%0A    /**%0A     * Called by HtmlSpeedServlet.init().%0A     *%0A     * @param servlet the single instance of HtmlSpeedServlet%0A     */%0A    public static void setServlet(HtmlSpeedServlet servlet)%0A    %7B%0A        _servlet = servlet;%0A    %7D%0A%0A    /**%0A     * CONSTRUCTOR%0A     *%0A     * @param url full url of loaded/refreshed page%0A     * @param pool used thread-poll%0A     */%0A    public RefreshTimerTask(String url, ExecutorService pool)%0A    %7B%0A        _url = url;%0A        _pool = pool;%0A        _refresher = new Refresher(_url);%0A    %7D%0A%0A    @Override%0A    public void run()%0A    %7B%0A        _pool.execute(_refresher);%0A    %7D%0A%0A    /**%0A     * Its run() method calls _servlet.service(request, response)%0A     * for loading/refreshing a statefull/stateless page.%0A     */%0A    private static class Refresher implements Runnable%0A    %7B%0A        private String _url;%0A%0A        public Refresher(String url)%0A        %7B%0A            _url = url;%0A        %7D%0A%0A        @Override%0A        public void run()%0A        %7B%0A            try%0A            %7B%0A                RefreshServletRequest request = new RefreshServletRequest(_url);%0A                RefreshServletResponse response = new RefreshServletResponse();%0A                _servlet.service(request, response);%0A            %7D%0A            catch (Exception exc)%0A            %7B%0A                exc.printStackTrace();%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Create RefreshTimerTask.java