/** * Wait a given number of milliseconds for the expected acks to be * received. If <code>msecs</code> milliseconds pass before all * acknowlegdements are received, <code>false</code> is returned. * * @param msecs the number of milliseconds to wait for replies * @throws InterruptedException if interrupted while waiting on latch * @throws ReplyException an exception passed back in reply * @throws InternalGemFireException if ack-threshold was exceeded and system * property "ack-threshold-exception" is set to true * @throws IllegalStateException if the processor is not registered to receive messages * * @return Whether or not we received all of the replies in the * given amount of time. */ public final boolean waitForReplies(long msecs) throws InterruptedException, ReplyException { return waitForReplies(msecs, getLatch(), true); }
/** * Wait a given number of milliseconds for the expected acks to be * received. If <code>msecs</code> milliseconds pass before all * acknowlegdements are received, <code>false</code> is returned. * * @param msecs the number of milliseconds to wait for replies * @throws InterruptedException if interrupted while waiting on latch * @throws ReplyException an exception passed back in reply * @throws InternalGemFireException if ack-threshold was exceeded and system * property "ack-threshold-exception" is set to true * @throws IllegalStateException if the processor is not registered to receive messages * * @return Whether or not we received all of the replies in the * given amount of time. */ public final boolean waitForReplies(long msecs) throws InterruptedException, ReplyException { return waitForReplies(msecs, getLatch(), true); }
/** * Wait a given number of milliseconds for the expected acks to be * received. If <code>msecs</code> milliseconds pass before all * acknowlegdements are received, <code>false</code> is returned. * <p> * Thread interruptions will be ignored while waiting. If interruption * occurred while in this method, the current thread's interrupt flag will * be true, but InterruptedException will not be thrown. * * @param p_msecs the number of milliseconds to wait for replies, zero will be * interpreted as Long.MAX_VALUE * * @throws ReplyException an exception passed back in reply * * @throws InternalGemFireException if ack-threshold was exceeded and system * property "ack-threshold-exception" is set to true * @throws IllegalStateException if the processor is not registered to receive replies */ public final boolean waitForRepliesUninterruptibly(long p_msecs) throws ReplyException { return waitForRepliesUninterruptibly(p_msecs, getLatch(), true); }
/** * Wait a given number of milliseconds for the expected acks to be * received. If <code>msecs</code> milliseconds pass before all * acknowlegdements are received, <code>false</code> is returned. * <p> * Thread interruptions will be ignored while waiting. If interruption * occurred while in this method, the current thread's interrupt flag will * be true, but InterruptedException will not be thrown. * * @param p_msecs the number of milliseconds to wait for replies, zero will be * interpreted as Long.MAX_VALUE * * @throws ReplyException an exception passed back in reply * * @throws InternalGemFireException if ack-threshold was exceeded and system * property "ack-threshold-exception" is set to true * @throws IllegalStateException if the processor is not registered to receive replies */ public final boolean waitForRepliesUninterruptibly(long p_msecs) throws ReplyException { return waitForRepliesUninterruptibly(p_msecs, getLatch(), true); }
/** do processing required when finished */ protected final void finished() { boolean isDone = false; synchronized (this) { if (!this.done) { // make sure only called once this.done = true; isDone = true; // getSync().release(); // notifies threads in waitForReplies getLatch().countDown(); } } // synchronized // ensure that postFinish is invoked only once if (isDone) { postFinish(); } }
/** do processing required when finished */ protected final void finished() { boolean isDone = false; synchronized (this) { if (!this.done) { // make sure only called once this.done = true; isDone = true; } } // synchronized // ensure that postFinish/countDown is invoked only once if (isDone) { postFinish(); // don't release the latch before postFinish else we may end up // waking up the waiter too soon // getSync().release(); // notifies threads in waitForReplies getLatch().countDown(); } }