org.javasimon.callback.async
Class Executors

java.lang.Object
  extended by org.javasimon.callback.async.Executors

public final class Executors
extends Object

This class contains some basic Executors.AsyncCallbackExecutors.

Author:
gerald

Nested Class Summary
private static class Executors.AsyncCallbackExecutor<T>
          Asynchronous, different thread executor
 
Field Summary
private static ExecutorService ASYNC_EXECUTOR_SERVICE
          Single threaded executor service used by default async
static Executor DISABLED
          Disabled Executor
static Executor SYNC
          Synchronous, same thread Executor
 
Constructor Summary
Executors()
           
 
Method Summary
static
<T> Executor<T>
async()
          Return asynchronous, different but unique thread executor
static
<T> Executor<T>
async(ExecutorService executorService)
          Return asynchronous, different thread executor
static
<T> Executor<T>
disabled()
          Return disabled executor
private static ExecutorService initAsyncExecutorService()
          Initializes default ingle threaded executor service
 void shutdownAsync()
          Stop thread used by default async executor
static
<T> Executor<T>
sync()
          Return synchronous, same thread executor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISABLED

public static Executor DISABLED
Disabled Executor


SYNC

public static Executor SYNC
Synchronous, same thread Executor


ASYNC_EXECUTOR_SERVICE

private static ExecutorService ASYNC_EXECUTOR_SERVICE
Single threaded executor service used by default async

Constructor Detail

Executors

public Executors()
Method Detail

initAsyncExecutorService

private static ExecutorService initAsyncExecutorService()
Initializes default ingle threaded executor service


disabled

public static <T> Executor<T> disabled()
Return disabled executor


sync

public static <T> Executor<T> sync()
Return synchronous, same thread executor


async

public static <T> Executor<T> async(ExecutorService executorService)
Return asynchronous, different thread executor


async

public static <T> Executor<T> async()
Return asynchronous, different but unique thread executor


shutdownAsync

public void shutdownAsync()
Stop thread used by default async executor



Copyright © 2013. All Rights Reserved.