]> source.dussan.org Git - vaadin-framework.git/commitdiff
Document that current session and UI are referenced weakly (#14595)
authorLeif Åstrand <leif@vaadin.com>
Thu, 4 Sep 2014 06:15:45 +0000 (09:15 +0300)
committerSauli Tähkäpää <sauli@vaadin.com>
Wed, 24 Sep 2014 18:58:03 +0000 (21:58 +0300)
Change-Id: Iccf6a2b0da6e47b5b14c40e0ebaab52df1eef92a

server/src/com/vaadin/server/VaadinSession.java
server/src/com/vaadin/ui/UI.java

index f93cb8e07039be567cf26222c66c12dd537109bc..e5d63a69611d6198c62feb5846d8be06da96b68e 100644 (file)
@@ -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
index d67e08828aa117651c24be3174921c96c6db452b..438b086ec28bd1c77befcec5c728d784cecf36d6 100644 (file)
@@ -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>
      *