Code example for ExecutorService

Methods: submit

0
 
    public boolean dispatch(Runnable job) {
        if (!isRunning() || job==null)
            return false; 
 
        es.submit(job);
        return true; 
    } 
 
    public void join() throws InterruptedException { 
        while(!es.awaitTermination(999, TimeUnit.DAYS))
            ; 
    } 
 
    public int getThreads() { 
        return 999; 
    } 
 
    public int getIdleThreads() { 
        return 999; 
    }