use of org.ff4j.audit.PublisherThreadFactory in project ff4j by ff4j.
the class ExceptionsTest method testExceptionHandler.
@Test
public void testExceptionHandler() {
EventRejectedExecutionHandler ereh = new EventRejectedExecutionHandler();
final BlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(2);
// Executor with worker to process threads
RejectedExecutionHandler rej = new EventRejectedExecutionHandler();
ThreadFactory tFactorty = new PublisherThreadFactory();
ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, queue, tFactorty, rej);
ereh.rejectedExecution(new Thread(), executor);
}
Aggregations