@Override public int compare(Object o1, Object o2) { ServerQueueStatus s1 = (ServerQueueStatus) o1; ServerQueueStatus s2 = (ServerQueueStatus) o2; // sort primaries to the front of the list if (s1.isPrimary() && !s2.isPrimary()) { return -1; } else if (!s1.isPrimary() && s2.isPrimary()) { return 1; } else { int diff = s1.getServerQueueSize() - s2.getServerQueueSize(); if (diff != 0) { return diff; } else { return s1.getMemberId().compareTo(s2.getMemberId()); } } } }
PoolImpl pool = (PoolImpl) this.qManager.getPool(); if (!pool.getReadyForEventsCalled()) { pool.setPendingEventCount(serverQueueStatus.getServerQueueSize());