use of org.apache.geode.cache.client.internal.ServerBlackList.BlackListListener in project geode by apache.
the class QueueManagerImpl method start.
public void start(ScheduledExecutorService background) {
try {
blackList.start(background);
endpointManager.addListener(endpointListener);
// Use a separate timer for queue management tasks
// We don't want primary recovery (and therefore user threads) to wait for
// things like pinging connections for health checks.
// this.background = background;
final String name = "queueTimer-" + this.pool.getName();
this.recoveryThread = new ScheduledThreadPoolExecutor(1, new ThreadFactory() {
public Thread newThread(Runnable r) {
Thread result = new Thread(r, name);
result.setDaemon(true);
return result;
}
});
recoveryThread.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
// TODO - use yet another Timer or the like for these tasks? We know
// we don't want them in the recoveryThread, because the ThreadIdToSequenceIdExpiryTask
// will wait for primary recovery.
getState().start(background, getPool().getSubscriptionAckInterval());
// initialize connections
initializeConnections();
scheduleRedundancySatisfierIfNeeded(redundancyRetryInterval);
// When a server is removed from the blacklist, try again
// to establish redundancy (if we need to)
BlackListListener blackListListener = new BlackListListenerAdapter() {
@Override
public void serverRemoved(ServerLocation location) {
QueueManagerImpl.this.scheduleRedundancySatisfierIfNeeded(0);
}
};
blackList.addListener(blackListListener);
factory.getBlackList().addListener(blackListListener);
} finally {
initializedLatch.countDown();
}
}
Aggregations