Refactor net2 connection pool to make it generic

unfortunately, go doesn't support generic, so we've back to casting everything like java1 ...