notnoop/java-apns — pull request #162 by jcourtney1 (2014-06-12 23:31:33+00:00)
Title: Expose control over thread creation through ApnsServiceBuilder.

This is critical to being able to use java-apns on controlled hosted systems like Google's App Engine where one cannot simply create new threads using "new Thread(...)" but must instead rely on an API like com.google.appengine.api.ThreadManager to obtain threads. This change adds parameterization and one new method to the ApnsServiceBuilder to allow the caller to pass java.util.concurrent.ThreadFactorys for various purposes including:

use by BatchApnsService (batch processing)
use by QueuedApnsService (queue processing)
use by ApnsConnectionImpl (error detection monitoring)

ApnsConnectionImply still names error detection threads and sets them as daemon in the default case but any passed ThreadFactory is entirely responsible for configuration of the threads it provides.

The only other change piggy-backed in here is simply specifying the correct generics type of the Future obtained in ApnsPooledConnection.sendMessage.