Code example for ThreadFactoryBuilder

0
import com.netflix.astyanax.connectionpool.impl.OperationResultImpl; 
 
public class TestConnectionFactory implements ConnectionFactory<TestClient> { 
    private final ConnectionPoolConfiguration config;
    private final ExecutorService executor = Executors.newFixedThreadPool(10,
            new ThreadFactoryBuilder().setDaemon(true).build());
    private final ConnectionPoolMonitor monitor;
 
    public TestConnectionFactory(ConnectionPoolConfiguration config,
            ConnectionPoolMonitor monitor) {
        this.config = config;
        this.monitor = monitor;
    } 
 
    @Override 
    public Connection<TestClient> createConnection(
            final HostConnectionPool<TestClient> pool)
            throws ThrottledException { 
        return new Connection<TestClient>() {
            private ConnectionException lastException;