1 package net.javacoding.jspider.mockobjects; 2 3 import net.javacoding.jspider.core.SpiderContext; 4 import net.javacoding.jspider.core.task.dispatch.BaseDispatchTaskImpl; 5 import net.javacoding.jspider.core.threading.WorkerThreadPool; 6 7 15 public class WaitTaskDispatcherTask extends BaseDispatchTaskImpl { 16 17 18 protected WorkerThreadPool threadPool; 19 20 21 protected int count; 22 23 24 protected int wait; 25 26 31 public WaitTaskDispatcherTask(WorkerThreadPool threadPool, SpiderContext context, int count, int wait) { 32 super(context); 33 this.threadPool = threadPool; 34 this.count = count; 35 this.wait = wait; 36 } 37 38 public void execute() { 39 for ( int i = 0; i < count; i++ ) { 40 threadPool.assign(new WaitTask(context, wait)); 41 } 42 } 43 44 } 45 | Popular Tags |