Fixed some exception problems.

This commit is contained in:
LevelX2 2018-01-27 11:42:43 +01:00
parent 9eb71e24be
commit 6b90c1fd7f
7 changed files with 32 additions and 19 deletions

View file

@ -66,6 +66,7 @@ public class Session {
private final Date timeConnected;
private boolean isAdmin = false;
private final AsynchInvokerCallbackHandler callbackHandler;
private boolean error = false;
private final ReentrantLock lock;
@ -370,10 +371,14 @@ public class Session {
}
public void fireCallback(final ClientCallback call) {
if (error) {
return;
}
try {
call.setMessageId(messageId++);
callbackHandler.handleCallbackOneway(new Callback(call));
} catch (HandleCallbackException ex) {
error = true; // to reduce repeated SESSION CALLBACK EXCEPTION
UserManager.instance.getUser(userId).ifPresent(user -> {
user.setUserState(User.UserState.Disconnected);
logger.warn("SESSION CALLBACK EXCEPTION - " + user.getName() + " userId " + userId + " - cause: " + getBasicCause(ex).toString());