* @since 7.0
*/
public abstract class VaadinService implements Serializable {
- private static final String REINITIALIZING_SESSION_MARKER = VaadinService.class
+ static final String REINITIALIZING_SESSION_MARKER = VaadinService.class
.getName() + ".reinitializing";
private static final Method SESSION_INIT_METHOD = ReflectTools.findMethod(
}
public void fireSessionDestroy(VaadinSession vaadinSession) {
- // Ignore if the session is being moved to a different backing session
- if (vaadinSession.getAttribute(REINITIALIZING_SESSION_MARKER) == Boolean.TRUE) {
- return;
- }
-
for (UI ui : new ArrayList<UI>(vaadinSession.getUIs())) {
// close() called here for consistency so that it is always called
// before a UI is removed. UI.isClosing() is thus always true in
+ "This might happen if a session is deserialized but never used before it expires.");
} else if (VaadinService.getCurrentRequest() != null
&& getCurrent() == this) {
+ // Ignore if the session is being moved to a different backing
+ // session
+ if (getAttribute(VaadinService.REINITIALIZING_SESSION_MARKER) == Boolean.TRUE) {
+ return;
+ }
+
// There is still a request in progress for this session. The
// session will be destroyed after the response has been written.
if (!isClosing()) {
<td>/run/com.vaadin.tests.applicationcontext.ChangeSessionId?restartApplication</td>
<td></td>
</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationcontextChangeSessionId::PID_SLog_row_0</td>
+ <td>1. Session id: *</td>
+</tr>
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestsapplicationcontextChangeSessionId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationcontextChangeSessionId::PID_SLog_row_0</td>
+ <td>2. Session id changed successfully from * to *</td>
+</tr>
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestsapplicationcontextChangeSessionId::/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationcontextChangeSessionId::PID_SLog_row_1</td>
- <td>2. Session id changed successfully from * to *</td>
+ <td>vaadin=runcomvaadintestsapplicationcontextChangeSessionId::PID_SLog_row_0</td>
+ <td>3. Session id: *</td>
</tr>
-
</tbody></table>
</body>
</html>