summaryrefslogtreecommitdiffstats
path: root/messagebus
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-01-06 22:02:38 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-01-06 22:02:38 +0100
commit762a33c2f39db024965d3e7063ae2eb7da2ef8b5 (patch)
tree9fd7fcae669248c22e77858e00c9e80ad7c81cb9 /messagebus
parent2befe14516136f67aec7cd6aa9f6262f29b79f6d (diff)
Need only one notify method
Diffstat (limited to 'messagebus')
-rw-r--r--messagebus/src/main/java/com/yahoo/messagebus/SourceSession.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/messagebus/src/main/java/com/yahoo/messagebus/SourceSession.java b/messagebus/src/main/java/com/yahoo/messagebus/SourceSession.java
index 407c8d5be2a..64d5f9843ee 100644
--- a/messagebus/src/main/java/com/yahoo/messagebus/SourceSession.java
+++ b/messagebus/src/main/java/com/yahoo/messagebus/SourceSession.java
@@ -189,13 +189,7 @@ public final class SourceSession implements ReplyHandler, Runnable {
this.msg = msg;
}
- private void notifyFailure(Result result) {
- synchronized (this) {
- this.result = result;
- notify();
- }
- }
- private void notifySuccess(Result result) {
+ private void notifyComplete(Result result) {
synchronized (this) {
this.result = result;
notify();
@@ -207,7 +201,7 @@ public final class SourceSession implements ReplyHandler, Runnable {
boolean notifyIfExpired() {
if (msg.isExpired()) {
Error error = new Error(ErrorCode.TIMEOUT, "Timed out in sendQ");
- notifyFailure(new Result(error));
+ notifyComplete(new Result(error));
replyHandler.handleReply(new SendTimeoutReply(msg, error));
return true;
}
@@ -218,7 +212,7 @@ public final class SourceSession implements ReplyHandler, Runnable {
if ( ! notifyIfExpired() ) {
Result res = sendInternal(msg);
if ( ! isSendQFull(res) ) {
- notifySuccess(res);
+ notifyComplete(res);
} else {
return false;
}