SessionDisconnectEvent actually preserves given session user

Issue: SPR-13871
This commit is contained in:
Juergen Hoeller 2016-01-15 17:03:17 +01:00
parent 9761af9ad8
commit cdc9bf76a9
1 changed files with 13 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -53,15 +53,24 @@ public class SessionDisconnectEvent extends AbstractSubProtocolEvent {
this(source, message, sessionId, closeStatus, null); this(source, message, sessionId, closeStatus, null);
} }
/**
* Create a new SessionDisconnectEvent.
* @param source the component that published the event (never {@code null})
* @param message the message
* @param sessionId the disconnect message
* @param closeStatus the status object
* @param user the current session user
*/
public SessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId, public SessionDisconnectEvent(Object source, Message<byte[]> message, String sessionId,
CloseStatus closeStatus, Principal user) { CloseStatus closeStatus, Principal user) {
super(source, message); super(source, message, user);
Assert.notNull(sessionId, "'sessionId' must not be null"); Assert.notNull(sessionId, "Session id must not be null");
this.sessionId = sessionId; this.sessionId = sessionId;
this.status = closeStatus; this.status = closeStatus;
} }
/** /**
* Return the session id. * Return the session id.
*/ */
@ -76,6 +85,7 @@ public class SessionDisconnectEvent extends AbstractSubProtocolEvent {
return this.status; return this.status;
} }
@Override @Override
public String toString() { public String toString() {
return "SessionDisconnectEvent[sessionId=" + this.sessionId + ", " + return "SessionDisconnectEvent[sessionId=" + this.sessionId + ", " +