adam bien's blog

Porcupine 0.0.3 Released 📎

The release v0.0.3 of the porcupine [see also screencast] of the concurrency utility for Java EE 7 is available in maven central:


<dependency>
	<groupId>com.airhacks</groupId>
	<artifactId>porcupine</artifactId>
	<version>0.0.3</version>
</dependency>

This version introduces two minor conveniency features:

  1. A custom configuration could be created more conveniently, partially overriding the defaults.
    
    import com.airhacks.porcupine.configuration.control.ExecutorConfigurator;
    import com.airhacks.porcupine.execution.control.ExecutorConfiguration;
    import javax.enterprise.inject.Specializes;
    
    @Specializes
    public class CustomExecutorConfigurator extends ExecutorConfigurator {
    
        @Override
        public ExecutorConfiguration forPipeline(String name) {
            if ("custom".equals(name)) {
                return new ExecutorConfiguration.Builder().
                        queueCapacity(1).
                        build();
            } else {
                return ExecutorConfiguration.defaultConfiguration();
            }
        }
    }
    
    
    
  2. For all statistic entities, the method toString was implemented for nicer debugging output: Rejection{statistics=Statistics{pipelineName=moviesThreadPool, remainingQueueCapacity=0, completedTaskCount=3, activeThreadCount=1, largestThreadPoolSize=1, currentThreadPoolSize=1, totalNumberOfTasks=9, maximumPoolSize=1, rejectedExecutionHandlerName=(...), rejectedTasks=1}, taskClass=(...)}

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. porcupine is used and discussed during the microservices workshop.