    public void run() {
        Thread thisThread = Thread.currentThread();
        ExecutorService executor = Executors.newFixedThreadPool(POOL_SIZE);
        while (curThread == thisThread) {
            List<WebURL> part = collectionHandler.getNextPart(this);
            for (WebURL url : part) {
                executor.submit(new PageProcessingTask(new Page(url), collectionHandler));
            }
            try {
                executor.shutdown();
                executor.awaitTermination(20, TimeUnit.MINUTES);
            } catch (InterruptedException e) {
                stop();
                e.printStackTrace();
            }
        }
    }

    public void run() {
        Thread thisThread = Thread.currentThread();
        while (curThread == thisThread) {
            List<WebURL> part = collectionHandler.getNextPart(this);
            ExecutorService executor = Executors.newFixedThreadPool(POOL_SIZE);
            for (WebURL url : part) {
                executor.submit(new PageProcessingTask(new Page(url), collectionHandler));
            }
            try {
                executor.shutdown();
                executor.awaitTermination(20, TimeUnit.MINUTES);
            } catch (InterruptedException e) {
                stop();
                e.printStackTrace();
            }
        }
    }
