aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-09-04 14:08:41 +0300
committerLeif Åstrand <leif@vaadin.com>2012-09-05 11:39:33 +0300
commitb3525638865cdea297c7f2e32c96221132af949f (patch)
tree32cf8874cfd0de5e5f1dcc05596cbeeaf87512b5 /server/src/com/vaadin/ui
parenta8f65623b64e64fbf4ccd885f1dfccf500e3dbf3 (diff)
downloadvaadin-framework-b3525638865cdea297c7f2e32c96221132af949f.tar.gz
vaadin-framework-b3525638865cdea297c7f2e32c96221132af949f.zip
Unify ThreadLocal handling (#9469)
Diffstat (limited to 'server/src/com/vaadin/ui')
-rw-r--r--server/src/com/vaadin/ui/UI.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index 7ae4e6bda3..e016e9432c 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -49,6 +49,7 @@ import com.vaadin.shared.ui.BorderStyle;
import com.vaadin.shared.ui.ui.UIConstants;
import com.vaadin.shared.ui.ui.UIServerRpc;
import com.vaadin.shared.ui.ui.UIState;
+import com.vaadin.util.CurrentInstance;
import com.vaadin.util.ReflectTools;
/**
@@ -450,11 +451,6 @@ public abstract class UI extends AbstractComponentContainer implements
*/
protected ActionManager actionManager;
- /**
- * Thread local for keeping track of the current UI.
- */
- private static final ThreadLocal<UI> currentUI = new ThreadLocal<UI>();
-
/** Identifies the click event */
private ConnectorTracker connectorTracker = new ConnectorTracker(this);
@@ -982,7 +978,7 @@ public abstract class UI extends AbstractComponentContainer implements
* @see ThreadLocal
*/
public static void setCurrent(UI ui) {
- currentUI.set(ui);
+ CurrentInstance.setInheritable(UI.class, ui);
}
/**
@@ -995,7 +991,7 @@ public abstract class UI extends AbstractComponentContainer implements
* @see #setCurrent(UI)
*/
public static UI getCurrent() {
- return currentUI.get();
+ return CurrentInstance.get(UI.class);
}
public void setScrollTop(int scrollTop) {