Code example for ThreadPoolExecutor

Methods: submit

	public void Download(abstractDownloadTask dlTask) {
		if (dlTask != null)
	protected void finalize() throws Throwable { 
		pool.shutdown(); // shutdown idle threads/tasks
		pool.shutdownNow(); // Cancel currently executing tasks
	    // Wait a while for tasks to respond to being cancelled 
	    if (!pool.awaitTermination(10, TimeUnit.SECONDS))
	       System.err.println("Some downloaders did not terminate");
	public long getSize() { 
Stop searching for code, let great code find you!  Add Codota to your java IDE