ReplicationResponseRepositoryEntry entry
= (ReplicationResponseRepositoryEntry) reposMap.get(id);
if(entry == null) {
return result;
}
LinkedBlockingQueue aQueue = entry.getQueue();
//block and wait for result until timeout
try {
result = (ReplicationState)aQueue.poll(waitTime, TimeUnit.MILLISECONDS);
} catch (InterruptedException ex) {
// FIXME evaluate logging level
if (_logger.isLoggable(Level.FINE)){
_logger.log(Level.FINE, "ReplicationResponseRepository>>getEntry timed out", ex);
}
} finally {
//clear entry from map
if (entry.removeRequest()) {
reposMap.remove(id);
if(aQueue != null) {
aQueue.clear();
repos.getQueueForQueues().offer(aQueue);
}
}
}
return result;