Executor

An object that executes submitted Runnable tasks. There are several static Executor factory methods available in the java.util.concurrent.Executors class.

It is similar to calling new Thread (aRunnableObject).start ();

This framework standardizes invocation, scheduling, and execution.

The Executor interface offers both synchronous and asynchronous execution of tasks.

For synchronous execution, use the following commands:

Class MySynExecutor implements Executor{
    public void execute(Runnable r) {
            r.run();
         }
}

For asynchronous execution, use the following commands:

Class MyASynExecutor implements Executor{
    public void execute(Runnable r) {
            new Thread(r).start();
         }
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.