Resource aware priority blocking queue implementation in Java