Added the ErrorHandler notifications to all try-catch blocks

This commit is contained in:
Jonas Bonér 2011-03-02 00:14:45 +01:00
parent 2127e8077e
commit c4e2d73668
17 changed files with 162 additions and 56 deletions

View file

@ -9,7 +9,8 @@ import java.util.concurrent._
import atomic.{AtomicLong, AtomicInteger}
import ThreadPoolExecutor.CallerRunsPolicy
import akka.util. {Duration}
import akka.util.Duration
import akka.actor.{ErrorHandler, ErrorHandlerEvent}
object ThreadPoolConfig {
type Bounds = Int
@ -207,8 +208,10 @@ class BoundedExecutorDecorator(val executor: ExecutorService, bound: Int) extend
})
} catch {
case e: RejectedExecutionException =>
ErrorHandler notifyListeners ErrorHandlerEvent(e, this)
semaphore.release
case e =>
ErrorHandler notifyListeners ErrorHandlerEvent(e, this)
throw e
}
}