Injectable, Configurable, Resilient and Monitorable ThreadPools in Java EE 7 -- Porcupine Is Available

The Apache 2.0 licensed Project Porcupine is based on JSR 236: Concurrency Utilities for Java EE and allows you to setup injectable thread pools on-the-fly.

Each thread pool is created according to sensible conventions and produces an injectable statistics POJO. Not only the configuration, but also all major components are extensible without any additional configuration:

import com.airhacks.porcupine.execution.boundary.Dedicated;
import java.util.concurrent.ExecutorService;
import javax.inject.Inject;

public class MessagesService {

    ExecutorService light;

    ExecutorService heavy;

The installation is easy:

and the dependency small (16 kB).

Enjoy and see you at Porcupine is heavily discussed during the workshops. Stay in touch with!.

Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition the podcast:

Stay in touch:



I have a question about using @Dedicated to inject java.util.concurrent.ExecutorService instance in a @Stateless bean that doesn't expose any rest method(s): if i call it from a junit test using CDITestRunner, the threadFactory class injected by container is null (NullPointerException). I suppose ThreadFactoryExposer doesn't produce java.util.concurrent.ThreadFactory outside a application ee container, is it true? Or is it a bug? Thanks

Posted by Roby on March 13, 2018 at 05:46 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
Online Workshops
...the last 150 posts
...the last 10 comments