Bug 1430: New common/util concurrent classes 05/9305/15
authortpantelis <tpanteli@brocade.com>
Sun, 27 Jul 2014 00:11:33 +0000 (20:11 -0400)
committertpantelis <tpanteli@brocade.com>
Mon, 28 Jul 2014 22:29:29 +0000 (18:29 -0400)
commitead44a5baba1149998c1bbc369f1ddbd1e8dc7a5
treef552c7682d8f66a297eba0be26ed30e2c61e2939
parent85d6b622b40e3c889bc2797b8eb2d4c3dced68c7
Bug 1430: New common/util concurrent classes

AsyncNotifyingListeningExecutorService:
    A ListeningExecutorService that executes ListenableFuture callback
    Runnables on another executor to off-load them.

AsyncNotifyingListenableFutureTask
    Listenable FutureTask used by AsyncNotifyingListeningExecutorService.

QueuedNotificationManager
    Manages queuing and dispatching notifications for multiple listeners
    concurrently. Notifications are queued on a per-listener basis and
    dispatched serially to each listener via an Executor.

FastThreadPoolExecutor
    Executor with a bounded queue that provides fast task execution time
    by favoring creating threads over queuing.

CachedThreadPoolExecutor
    Executor with a bounded queue that favors reusing existing idle
    threads over creating new threads at the expense of slower task
    execution time.

SpecialExecutors
    Factory methods for creating Fast/CachedThreadPoolExecutor
    instances.

Change-Id: Ie0d2f4d4e0561976c6956d551e386da78631aafa
Signed-off-by: tpantelis <tpanteli@brocade.com>
16 files changed:
common/util/pom.xml
common/util/src/main/java/org/opendaylight/yangtools/util/ExecutorServiceUtil.java
common/util/src/main/java/org/opendaylight/yangtools/util/PropertyUtils.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/AsyncNotifyingListenableFutureTask.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/AsyncNotifyingListeningExecutorService.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/CachedThreadPoolExecutor.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/DeadlockDetectingListeningExecutorService.java
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/FastThreadPoolExecutor.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/NotificationManager.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/QueuedNotificationManager.java [new file with mode: 0644]
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/SpecialExecutors.java [new file with mode: 0644]
common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/AsyncNotifyingListeningExecutorServiceTest.java [new file with mode: 0644]
common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/CommonTestUtils.java [new file with mode: 0644]
common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/DeadlockDetectingListeningExecutorServiceTest.java
common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/QueuedNotificationManagerTest.java [new file with mode: 0644]
common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/ThreadPoolExecutorTest.java [new file with mode: 0644]