FileDocCategorySizeDatePackage
SingleThreadAccess.javaAPI DocExample685Sat May 29 23:12:12 BST 2004javathreads.examples.ch10

SingleThreadAccess

public class SingleThreadAccess extends Object

Fields Summary
private ThreadPoolExecutor
tpe
Constructors Summary
public SingleThreadAccess()

        tpe = new ThreadPoolExecutor(
        	1, 1, 50000L, TimeUnit.SECONDS,
        	new LinkedBlockingQueue<Runnable>());
    
Methods Summary
public voidinvokeAneWait(java.lang.Runnable r)

        FutureTask task = new FutureTask(r, null);
        tpe.execute(task);
        task.get();
    
public voidinvokeLater(java.lang.Runnable r)

        tpe.execute(r);
    
public voidshutdown()

        tpe.shutdown();