/** * Decides whether the client has received tap messages or will receive more * messages in the future. * * @return true if the client has tap responses or expects to have responses * in the future. False otherwise. */ public boolean hasMoreMessages() { if (!rqueue.isEmpty()) { return true; } else { synchronized (omap) { Iterator<TapStream> itr = omap.keySet().iterator(); while (itr.hasNext()) { TapStream ts = itr.next(); if (ts.isCompleted() || ts.isCancelled() || ts.hasErrored()) { omap.get(ts).shutdown(); omap.remove(ts); } } if (omap.size() > 0) { return true; } } } return false; }
/** * Decides whether the client has received tap messages or will receive more * messages in the future. * * @return true if the client has tap responses or expects to have responses * in the future. False otherwise. */ public boolean hasMoreMessages() { if (!rqueue.isEmpty()) { return true; } else { synchronized (omap) { Iterator<TapStream> itr = omap.keySet().iterator(); while (itr.hasNext()) { TapStream ts = itr.next(); if (ts.isCompleted() || ts.isCancelled() || ts.hasErrored()) { omap.get(ts).shutdown(); omap.remove(ts); } } if (omap.size() > 0) { return true; } } } return false; }
/** * Decides whether the client has received tap messages or will receive more * messages in the future. * * @return true if the client has tap responses or expects to have responses * in the future. False otherwise. */ public boolean hasMoreMessages() { if (!rqueue.isEmpty()) { return true; } else { synchronized (omap) { Iterator<TapStream> itr = omap.keySet().iterator(); while (itr.hasNext()) { TapStream ts = itr.next(); if (ts.isCompleted() || ts.isCancelled() || ts.hasErrored()) { omap.get(ts).shutdown(); omap.remove(ts); } } if (omap.size() > 0) { return true; } } } return false; }
/** * Decides whether the client has received tap messages or will receive more * messages in the future. * * @return true if the client has tap responses or expects to have responses * in the future. False otherwise. */ public boolean hasMoreMessages() { if (!rqueue.isEmpty()) { return true; } else { synchronized (omap) { Iterator<TapStream> itr = omap.keySet().iterator(); while (itr.hasNext()) { TapStream op = itr.next(); if (op.isCompleted() || op.isCancelled() || op.hasErrored()) { omap.get(op).shutdown(); omap.remove(op); } } if (omap.size() > 0) { return true; } } } return false; }