diff options
author | Leif Åstrand <leif@vaadin.com> | 2014-09-04 09:15:45 +0300 |
---|---|---|
committer | Sauli Tähkäpää <sauli@vaadin.com> | 2014-09-24 21:58:03 +0300 |
commit | 62b1e1c0c00889ac28aab6f8c6b00e5068dbaad7 (patch) | |
tree | ade741bfbbfcc0cf4bb0bf06f716319b2f5be7fd /server/src | |
parent | bed7e19dae06f53d57fcab5c3c53bf76cdfd9792 (diff) | |
download | vaadin-framework-62b1e1c0c00889ac28aab6f8c6b00e5068dbaad7.tar.gz vaadin-framework-62b1e1c0c00889ac28aab6f8c6b00e5068dbaad7.zip |
Document that current session and UI are referenced weakly (#14595)
Change-Id: Iccf6a2b0da6e47b5b14c40e0ebaab52df1eef92a
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/com/vaadin/server/VaadinSession.java | 8 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/UI.java | 9 |
2 files changed, 14 insertions, 3 deletions
diff --git a/server/src/com/vaadin/server/VaadinSession.java b/server/src/com/vaadin/server/VaadinSession.java index f93cb8e070..e5d63a6961 100644 --- a/server/src/com/vaadin/server/VaadinSession.java +++ b/server/src/com/vaadin/server/VaadinSession.java @@ -721,6 +721,9 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * {@link InheritableThreadLocal}). In other cases, (e.g. from background * threads started in some other way), the current session is not * automatically defined. + * <p> + * The session is stored using a weak reference to avoid leaking memory in + * case it is not explicitly cleared. * * @return the current session instance if available, otherwise * <code>null</code> @@ -741,9 +744,12 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * The application developer can also use this method to define the current * session outside the normal request handling and treads started from * request handling threads, e.g. when initiating custom background threads. - * </p> + * <p> + * The session is stored using a weak reference to avoid leaking memory in + * case it is not explicitly cleared. * * @param session + * the session to set as current * * @see #getCurrent() * @see ThreadLocal diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index d67e08828a..438b086ec2 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -719,9 +719,11 @@ public abstract class UI extends AbstractSingleComponentContainer implements * The application developer can also use this method to define the current * UI outside the normal request handling, e.g. when initiating custom * background threads. - * </p> + * <p> + * The UI is stored using a weak reference to avoid leaking memory in case + * it is not explicitly cleared. * - * @param uI + * @param ui * the UI to register as the current UI * * @see #getCurrent() @@ -735,6 +737,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements * Gets the currently used UI. The current UI is automatically defined when * processing requests to the server. In other cases, (e.g. from background * threads), the current UI is not automatically defined. + * <p> + * The UI is stored using a weak reference to avoid leaking memory in case + * it is not explicitly cleared. * * @return the current UI instance if available, otherwise <code>null</code> * |