-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix inspection and injection of Vaadin scoped beans (#152)
Vaadin scoped beans requires VaadinSession and UI thread locals to be set in order to lookup beans. This change tracks Vaadin scoped beans during serialization and makes sure that required thread locals are set during deserialization. The serialVersionUID added to TransientDescriptor should keep it compatible with older version, preventing deserialization of previous data to fail. Fixes #140 Requires vaadin/flow#20394 Co-authored-by: Tamas Mak <tamas@vaadin.com>
- Loading branch information
1 parent
978c7c6
commit b404a35
Showing
11 changed files
with
799 additions
and
62 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...m/vaadin/kubernetes/starter/sessiontracker/PessimisticSerializationRequiredException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/*- | ||
* Copyright (C) 2022 Vaadin Ltd | ||
* | ||
* This program is available under Vaadin Commercial License and Service Terms. | ||
* | ||
* | ||
* See <https://vaadin.com/commercial-license-and-service-terms> for the full | ||
* license. | ||
*/ | ||
package com.vaadin.kubernetes.starter.sessiontracker; | ||
|
||
/** | ||
* Exception raise during session serialization to indicate that VaadinSession | ||
* lock is required to complete the operation. | ||
*/ | ||
public class PessimisticSerializationRequiredException | ||
extends RuntimeException { | ||
|
||
/** | ||
* Constructs a new exception with the specified detail message. | ||
* | ||
* @param message | ||
* the detail message. The detail message is saved for later | ||
* retrieval by the {@link #getMessage()} method. | ||
*/ | ||
public PessimisticSerializationRequiredException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs a new exception with the specified detail message and cause. | ||
* | ||
* @param message | ||
* the detail message. | ||
* @param cause | ||
* the cause. (A {@code null} value is permitted, and indicates | ||
* that the cause is nonexistent or unknown.) | ||
*/ | ||
public PessimisticSerializationRequiredException(String message, | ||
Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.