Skip to content
Merged

RC #18

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/badges/jacoco.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,21 @@ public <T> T invokeRemoteMethod(InvocationDescriptor invocationDescriptor) throw
}
}

public void completeInvocation(InvocationResponse invocationResponse) {
public boolean completeInvocation(InvocationResponse invocationResponse) {
// do we have a pending invocation for this invocation id?
PendingInvocation<?> pendingInvocation = pendingInvocations.get(invocationResponse.getInvocationId());
if (pendingInvocation == null) {
throw new IllegalStateException("No pending invocation found for invocation id " + invocationResponse.getInvocationId() + ". Data: " + invocationResponse.getResult());
//return;
// we cannot handle this invocation, so it must be handled in another listener
return false;
}

pendingInvocation.complete(invocationResponse.getResult());

// remove the pending invocation from the map
pendingInvocations.remove(invocationResponse.getInvocationId());

// invocation was successfully completed
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public TransportHandler(

private boolean handleInvocationResponse(byte[] bytes) throws ClassNotFoundException {
InvocationResponse invocationResponse = InvocationResponse.fromBytes(serializer, bytes);
outgoingInvocationTracker.completeInvocation(invocationResponse);
return true;
return outgoingInvocationTracker.completeInvocation(invocationResponse);
}

private boolean handleInvocationRequest(byte[] bytes) throws ClassNotFoundException {
Expand Down